in reply to Re^2: greping thru a hash of arrays
in thread greping thru a hash of arrays
grep /$_/, [ @{$tbl{$i}} ]
means:
Dereference the array-Ref in $tbl{$i}, make a reference to an anonymous array ( [ ] ) from the resulting list and grep through a list with a single item: the single reference to the anonymous array.
$perl perl use strict; use warnings; my %hash; $hash{a} = [ 1,2 ]; print "@hash{a}", $/; Scalar value @hash{a} better written as $hash{a} at - line 7.
edit: several updates/corrections due to some misleading thoughts while typing too fast
|
|---|