grep and glob are often very useful, for example:
my $dir = '.'; my $match = 'perl'; my @files = grep { -f } glob ( "$dir/*" ); for my $file(@files) { open my $fh, $file or next; print "Found match in $file\n" if grep{ /\Q$match\E/ }<$fh>; }
cheers
tachyon
In reply to Re^2: Get Filename using perl
by tachyon
in thread Get Filename using perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |