Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

map in an avoid context

by jmcnamara (Monsignor)
on Apr 09, 2001 at 15:11 UTC ( [id://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.
--


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-20 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found