print "Enter a string: "; chomp(my $_ = ); if ($_ = /(a|b|x)/i) { print "Its a good match\n"; } else { print "That was not a good match\n"; } print "Enter a string: "; chomp(my $teststring = ); if ($teststring =~ m{ /(a|b|x)/}i) { print "Its a good match\n"; } else { print "That was not a good match\n"; }