Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Strange grep construct

by choroba (Cardinal)
on Apr 12, 2019 at 12:16 UTC ( [id://1232486]=note: print w/replies, xml ) Need Help??


in reply to Strange grep construct

Fat comma would have interpreted lc as a string. Normal comma would have been less pretty.

The whole dereferencing is a bit complex, but it basically uses the @hash{key1, key2} slice syntax. I.e., the first map maps lower case strings from @a to their originals, this is inserted into an anonymous hash, and only the values corresponding to lowercased elements of @b are returned to the outer grep that selects the defined ones.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Strange grep construct
by mzvk (Novice) on Apr 12, 2019 at 12:29 UTC
    Ah, now I see. Thanks a lot!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-29 13:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found