if($s_line =~ /$str/){ print "$str -- match\n"; } else { print "$str -- no match\n"; }