Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How can I find the index of the biggest element in an array?

by EdgeNosedMonkey (Initiate)
on Feb 17, 2013 at 18:55 UTC ( [id://1019190]=note: print w/replies, xml ) Need Help??


in reply to How can I find the index of the biggest element in an array?

Also if your question is specifically about finding the largest number, the following code should work just fine :
%arrayHash=map {$_=> $i++} @array=(-15,4,8,10,3,2,7); print $arrayHash{pop [sort {$a<=>$b} @array]};

Originally posted as a Categorized Answer.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2025-06-21 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.