view full story

http://www.unix.com – Hi im trying a GREP a varaiable which contains a file name and i search it in a list of .txt file and ifs its found the .txt file , it returns the name of the txt file name..the snippet im using is Code: foreach my $files (glob('*.txt')) { open(my $fh1, $files) or die("Unable to open '$files': $!"); { if ( grep /$file/, <$fh1> ) { $Sheet->Cells($row,$col+1)->{'Value'} = $files; close ($fh1); GREP is working fine but the issue is if $file contains apple.txt and when i search it in the text files the following patterns are getting matched _apple.txt ... I wa (HowTos)