Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: min and mindex

by tinita (Parson)
on Nov 07, 2012 at 00:03 UTC ( #1002606=note: print w/ replies, xml ) Need Help??


in reply to min and mindex

use List::Util qw/ reduce /; my $min_index = reduce { $array1[$a] <= $array1[$b] ? $a : $b } 0 .. $ +#array1; say <<"EOM"; min element: $array1[ $min_index ] min index: $min_index array2: $array2[ $min_index ] EOM


Comment on Re: min and mindex
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-07-30 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls