my $start_dir= "\\server1\tools"; my $file_name = "load.c"; my @filematches; opendir(DIR, "$start_dir"); @xml_files = grep(/\.xml$/,readdir(DIR)); print "XML FILES\n"; print "@xml_files\n"; --->All the xml files print fine closedir(DIR); push @filematches, grep( /\/\Q$file_name\E#/i, @xml_files); print @filematches;
why isn't the above code printing anything even though "load.c" matched the xml files in @xml_files?Pls help
ThanksIn reply to Grep on a list of files in directory by iphone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |