Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

map in an avoid context

by jmcnamara (Monsignor)
on Apr 09, 2001 at 15:11 UTC ( #70970=note: print w/ replies, xml ) Need Help??


in reply to Shortest -return index of element in array- sub


This takes my original map idea to its natural(?) conclusion. 23 chars:

sub array_index { @_{@_}=-1..@_; $_{$_[0]} }


John.
--



Comment on map in an avoid context
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-03 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls