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"; }
In reply to (tye)Re: Partial extractions on hashes
by tye
in thread Partial extractions on hashes
by OzzyOsbourne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |