in reply to Reading all files in a directory with one filehandle
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); }
|
|---|