Just with map:
use strict; use warnings; use Data::Dumper; my $orig = { 'foo' => 2, 'bar' => 4, 'boo' => 1, 'zar' => 5 }; my $dest; map { /oo/ and $dest->{$_} = $orig->{$_} } keys %$orig; print Dumper $dest; __END__ Output: $VAR1 = { 'boo' => 1, 'foo' => 2 };
hth,
PooLpi
In reply to Re: grep for hash?
by poolpi
in thread grep for hash?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |