in reply to Problem with input strings that have "[]" brackets

You can also do the following

my $line = ' [Category("notestrecord")]'; my $pattern = 'Category("notestrecord")'; if($line =~ /\Q$pattern/) { print "We have a match!"; } else { print "No match!"; }


By adding the \Q switch before the $pattern is the regex match