in reply to HoA, grep or exists?

exists is intended for testing for the presence of a key in a hash. While it can also test for the presence of an array element at a given index, the use of exists on arrays is deprecated.</c>

Therefore, grep is the appropriate way to test the values of an array.

Replies are listed 'Best First'.
Re^2: HoA, grep or exists?
by teamassociated (Sexton) on Nov 20, 2014 at 23:16 UTC
    Solved it, using:
    OUTER: foreach my $vhname (sort keys %vhosts) { for ($i = 0; $i <= $#{$vhosts{$vhname};}; ++$i) { if ($b eq $vhosts{$vhname}[$i]) { print "found '${b}'\n"; last OUTER; } } } # perl foo found 'l02duapofqa2_d1'