if ($sentence =~ /foo/gis && $sentence =~ /bar/gis) { # do something further with $sentence }