foreach my $file ( glob('/tmp/files/*') ) { print "\n\nThe File is $file\n\n"; open (MYFILE, "<$file") or die $! ; while (<MYFILE>) { chomp; if ( $_ =~ m/map/i ) { print "$_ in $file\n"; } } close (MYFILE); }
In reply to Re: Reading all files in a directory with one filehandle
by Loops
in thread Reading all files in a directory with one filehandle
by rahulruns
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |