@words = split $string; $found = 1; foreach my $word (@words) { unless ($file =~ /$word/ ) { $found = 0; $last; } } print "Found: $string" if $found;