Revision 24fadf2a20f50d5623f61f2cc08f95c22b5ba75c authored by Dr. Stephen Henson on 03 January 2012, 19:43:06 UTC, committed by Dr. Stephen Henson on 03 January 2012, 19:43:06 UTC
1 parent 409abd2
extract-names.pl
#!/usr/bin/perl
$/ = ""; # Eat a paragraph at once.
while(<STDIN>) {
chop;
s/\n/ /gm;
if (/^=head1 /) {
$name = 0;
} elsif ($name) {
if (/ - /) {
s/ - .*//;
s/,\s+/,/g;
s/\s+,/,/g;
s/^\s+//g;
s/\s+$//g;
s/\s/_/g;
push @words, split ',';
}
}
if (/^=head1 *NAME *$/) {
$name = 1;
}
}
print join("\n", @words),"\n";

Computing file changes ...