in reply to Searching a file for two strings
If you've got those two lines in one $string, you can do so
If you have those lines in a String calles $_, then:if ($string =~ /\[message\]/ and $string =~ /\[here\]/ ){ ...
If you have got the two lines in two different strings $string1 and $string2, tryif (/\[message\]/ and /\[here\]/ ){ ...
if ($string1 =~ /\[message\]/ and $string2 =~ /\[here\]/ ){ ...
Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"
|
|---|