while ( ($key, $value) = each %HoA ){ # Construct the array foreach my $nextItem (@{$HoA{$key}}) { push @newArr, $nextItem; } # See if array contains $a if (grep {$_ eq $a} @newArr) { print "Element '$a' found!\n" ; } }
In reply to Have hash of arrays. Want to test if variable is a member of any of the arrays by batrams
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |