Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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.
--


Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://70970]
help
Chatterbox?
[Lady_Aleena]: I did it! I did it! I did it! # it eq made a page better with a browse feature instead of listing everything at once.
Lady_Aleena feels so good about it.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2017-05-28 07:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?