Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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?
[GotToBTru]: 99% of all deaths take place within 24 hours of ingesting di-hydrogen monoxide
[GotToBTru]: time for some C8H10N4O2 for me

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2016-12-06 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (104 votes). Check out past polls.