in reply to Re: Parsing an Array of Hashes, Modifying Key/Value Pairs
in thread Parsing an Array of Hashes, Modifying Key/Value Pairs
just wondering:
using exists is a bit redundant if you already intialize the hash with true values...my @keeps = qw{a b}; my %to_keep = map { $_ => 1 } @keeps; ... delete @$sms_ref{ grep { ! exists $to_keep{$_} } keys %$sms_re +f };
so either dropping the exists
or initializing with undef... delete @$sms_ref{ grep { ! $to_keep{$_} } keys %$sms_ref };
my %to_keep; @to_keep{ qw{a b} } = (); ...
should have the same effect.
Or am I missing something?
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parsing an Array of Hashes, Modifying Key/Value Pairs
by kcott (Archbishop) on May 14, 2013 at 04:11 UTC |