in reply to Re: min and mindex
in thread min and mindex
++ I like your thinking, jaredor!
So, what's the rules of this drinking game? No doubt I lost points when I failed to utter the incantantion "Schwartzian transform" while coding:
my $min_pos = ( sort { $a->[0] <=> $b->[0] } map { [$_ => ++$pos] } @array1 )[0]; # do useful stuff print ... $array2[$min_pos->[1]]
OK, I've downed a large Scotch. Your turn. :-)
-- Ken
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: min and mindex
by jaredor (Priest) on Nov 10, 2012 at 03:02 UTC |
In Section
Seekers of Perl Wisdom