Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: extracting elements by key from an array of hashes

by mr_ron (Chaplain)
on Sep 26, 2015 at 00:52 UTC ( [id://1143064]=note: print w/replies, xml ) Need Help??


in reply to Re^2: extracting elements by key from an array of hashes
in thread extracting elements by key from an array of hashes

Another cleaner variant that works with the initial data structure.
my @aoh = ( {k0 => 'v0' } , {k1 => 'v1' } , {k2 => 'v2' } , {k3 => 'v3' } ); my ($val) = grep {exists $_->{k2}} @aoh; $val &&= $val->{k2};

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1143064]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-20 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found