- or download this
use strict; use warnings;
use List::Util 'all';
...
if ( $all_found ) {
...
}
- or download this
my %hash = @allwords; #puts array in hash to search / compare.
- or download this
@array = ('foo', 'bar', 'baz', 'qux');
%hash = map { $_ => 1 } @array;
- or download this
if (exists $hash{'word1' && 'word2' && 'word3'}) {
...do stuff ;
}
- or download this
if ( exists $hash{'foo'} and exists $hash{'bar'} ) {
...
}
- or download this
if ( grep { $_ eq 'word1' && 'word2' } @allwords ) {
...do stuff;
}