#!/usr/bin/perl use strict; use warnings; # "use Diagnostics;" might help you, too. # 948631 my $str1 = qr/hi\(/; # Note use of qr here; see perldoc perlre or perlretut # Escaped paren; no more complaints from the regex engine my $str2 = "hi"; # All lc did NOT work until the paren was escaped if ($str2 =~ $str1) { print "Match: Yes\n"; } else { print "Match: No\n"; } say "Now, using 'eq'"; if ($str2 eq $str1) { print "Match: Yes\n"; } else { print "Match: No\n"; }