C:\Temp>perl -e "BEGIN{open(H,q|watchdog.dat|) or die $!; @watchdog = ; close (H);} my $newFile; foreach my $watchdog (@watchdog){if($watchdog=~m/(#STANDARD.* ?function\s+(\S+)!)/){ $newFile .= qq|\=item| . ++$item . qq| $2\n$1\n|}}; END{ print qq|=head1 Functions\n\nThis is my list of functions\n\n$newFile\n\n=cut\n\ n|}" > sha.pod