ashok13123 has asked for the wisdom of the Perl Monks concerning the following question:
I want to search for each of these elements and report if any of them is missing. I can do it byjanuary february egypt moon saturday
How can I reduce the code size and I should be able to report if any element is missing?????? One more doubt..... If one of the element is to search is a regex likeopen(FH,"file.txt"); @arr=<FH>; $var=join("",@arr); if($var=~ /january/) { print "january\n"; } else { print "january not present\n"; } if($var=~/february/) { print "february\n"; } else { print "february not present\n"; } if($var=~/egypt/) { print "Egypt is present"; } else { print "Egypt not present"; } etc...........
How can I include those values in the search and maintain the properties of pattern matching???a.*e <sample>(.*?)</sample> etc
|
|---|