my %d; while () { my ($file, $line, $comment) = /^([^:]+):(\d+)\s+(.*)/ or warn("unknown line, skipping: $_"), next; push @{$d{$file}{$line}}, $comment; } use Template; Template->new->process(\<<'EOT', { d => \%d, env => \%ENV }) [%# USE Dumper; Dumper.dump(d); -%] [%- FOREACH filek = d.keys.sort; filev = d.$filek; FOREACH linek = filev.keys.nsort; linev = filev.$linek; "
$filek
line $linek\n"; FOREACH comment = linev; " \n" IF loop.last; END; "
\n"; END; END; -%] EOT or die Template->error; __END__ comment_tmpl.tt2:1 This would be more readable if I turned on Template's space-stripping options. comment_reader.pl:31 More informative error message would probably be good. comment_reader.pl:71 Need a better explanation of data structure. annotate.el:1 Should properly be in a mode... annotate.el:11 Should be configurable variable annotate.el:13 Formatting should be configurable in variable annotate.el:11 Should automatically make "annotations" visible if it isn't already annotate.el:21 Control-c keys are supposed to be for mode-specifics...