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

Re^2: howto map/grep a complex structure

by NetWallah (Canon)
on Aug 27, 2015 at 05:53 UTC ( [id://1140154]=note: print w/replies, xml ) Need Help??


in reply to Re: howto map/grep a complex structure
in thread howto map/grep a complex structure

You are SEARCHING (grep) not TRANSFORMING (map), so map is not necessary.

Here is a one-liner that works, but I would not recommend writing unreadable code like this.

print for grep { grep {$search eq $_ } @{$href->{$_}->{member}} } keys %$href;

        Clarity: it's like that one thing that is not the other thing, except for when it is.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-23 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found