Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002606]
help
Chatterbox?
[Corion]: :-D
[Corion]: Di-hydrogen monoxide is even worse!
choroba needs some CH3CH2OH

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2016-12-06 12:51 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.