in reply to Re: Partial extractions on hashes
in thread Partial extractions on hashes
You can shorten that quite a bit:
- tye (but my friends call me "Tye")%hash = ('k1' => 'abc', 'k2' => 'def', 'k3' => '123abcdef456'); @array = map $hash{$_} =~ /abc/ ? $_ : (), keys %hash; foreach (@array) { print "$_: $hash{$_}\n"; }
|
|---|