in reply to Find, read, write out contents of a certain file type recursively...
Adding the HTML is left as an exercise. :-)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; }
jdporter
...porque es dificil estar guapo y blanco.
|
|---|