- or download this
my $matches = 0;
foreach my $item (@items) {
$matches++ if grep( $item eq $_, @list );
}
print "All match!" if $matches == @items;
- or download this
my %st = map { $_ => undef } @list;
my $matches = 0;
...
$matches++ if exists $st{$item};
}
print "All match!" if $matches == @items;
- or download this
use List::AutoST;
my $list = List::AutoST->new();
...
# or (also via overload)
print "Ok!" if exists $list{'this value'};