in reply to Find, read, write out contents of a certain file type recursively...

Here's one way to do it.
use File::Find; my $jscriptdir = "/home/javascript/"; my $pat = quotemeta '//**'; find( \&proc, $jscriptdir ); sub proc { /\.js$/ or return; my $n = $File::Find::name; open F, "< $n" or die "read $n: $!\n"; my @l = map { s/^$pat// ? $_ : () } <F>; close F; @l or return; $n =~ s/\Q$jscriptdir\E.//; print "$n $_" for @l; }
Adding the HTML is left as an exercise. :-)

jdporter
...porque es dificil estar guapo y blanco.

  • Comment on Re: Find, read, write out contents of a certain file type recursively...
  • Download Code