praveenchappa has asked for the wisdom of the Perl Monks concerning the following question:
i had a perl script that traverses throuh the file hirarchy and searches for a particular string and gives the count of files the string is present,the problem is when the search string contains '.' the match is not being done ...please help
$string="hai hello hello.doc yes hai hello.doc present in the file"; $oldstring="hello.doc"; if($string=~ m/\Q$oldstring\E/){ print "\nstring found in ...\n$File::Find::name"; $i++; }
i am taking $oldstring from command line argunments and $string is contents of file i even tried "hello\.doc"but the match is not being done
Back to
Seekers of Perl Wisdom