use warnings; use strict; my $string = '@@@'; if ( $string =~ m|\$\@| ){ print "Yes!\n"; } else { print "\'$string\' did not match...\n"; } # prints "'@@@' did not match..."