in reply to using grep to match more than two words
sub isTargetInAll { my ($raAll, $raTarget) = @_; return @$raTarget == grep { exists { map { $_ => 1 } @$raAll }->{$_} } @$raTarget; }
I think that should be reliable as long as @$raTarget doesn't contain duplicates; if you were looking for a Sun and two Moons you would get a false positive if @$raAll had a Sun and just one Moon.
Cheers,
JohnGG
|
|---|