in reply to How can I find the index of the biggest element in an array?
A one-liner where the array elements are the command line arguments:
$ perl -E 'say [ sort { $ARGV[$b] <=> $ARGV[$a] } 0..$#ARGV ]->[0]' 42 + 1000 999 0 -1
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Answer: How can I find the index of the biggest element in an array?
by reisinge (Hermit) on Mar 14, 2017 at 14:11 UTC | |
by marioroy (Prior) on Mar 15, 2017 at 08:55 UTC | |
by reisinge (Hermit) on Mar 15, 2017 at 11:22 UTC |
In Section
Seekers of Perl Wisdom