if ($concat !~ /other stuff\Q$string\E more other stuff/) { $concat .= " and $string"; }