in reply to how to search 3 different patterns from a file
Hi, try this, using one pattern match and try to all pattern like this
undef $/; open(IN, 'd:\temp.log'); $str = <IN>; (@str) = $str =~ m#(note;.*?)\n#gsi; local $"="\n"; print "@str"; $pass = scalar(@str); if($pass >= 3) { print "Passed"; } else { print "Failed"; }
|
|---|