Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Taking a subset of a hash

by james2vegas (Chaplain)
on Oct 30, 2010 at 13:18 UTC ( #868468=note: print w/replies, xml ) Need Help??


in reply to [Answered!] Taking a subset of a hash

@small_hash{@interesting_keys} = @$config{@interesting_keys}; delete @small_hash{ grep { ! $config->{$_} } keys %$config };
should work

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://868468]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2017-02-27 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (388 votes). Check out past polls.