in reply to Escaping parentheses in regexps

You could try using the index function. Then you won't have to worry about escaping characters (at least in this scenario):
my $concat = "good times and fun (times) and bad (times)"; for my $string ('good times', 'bad times', 'fun (times)') { # if the index function returns -1, it is not a substring if (index($concat, $string) == -1) { $concat .= " and $string"; } } print $concat . "\n";