my $x = "foobar"; print "matches 1\n" if ($x =~ m/foo bar/x); # succeeds print "matches 2\n" if ($x =~ m/foo bar/); # fails