if ($string =~ /\[message\]/ and $string =~ /\[here\]/ ){ ... #### if (/\[message\]/ and /\[here\]/ ){ ... #### if ($string1 =~ /\[message\]/ and $string2 =~ /\[here\]/ ){ ...