in reply to Partial extractions on hashes
%hash = ('k1' => 'abc', 'k2' => 'def', 'k3' => '123abcdef456'); @array = map { $_->[1] } grep { $_->[1] =~ /abc/ } map { [$_, $hash{$_ +}] } keys %hash); foreach (@array) { print $hash{$_}, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Partial extractions on hashes
by tye (Sage) on May 12, 2001 at 01:57 UTC |