my $sentence = "foo bar"; if ($sentence =~ /foo/gis && $sentence =~ /bar/gis) { print "Got here\n"; }