sub containsAll { my ($arrEverything, $arrRequire) = @_; my %stillRequired = map { $_ => 1 } @$arrRequire; for my $entry ( @$arrEverything ) { if ( delete($stillRequired{$entry}) ) { last unless %stillRequired; } } return %stillRequired ? 0 : 1; }