my $n = 3; # top three my @highest = (sort { $b <=> $a } @num)[0 .. $n-1];
In reply to Re: How to find the N largest values in an array?
by japhy
in thread How to find the N largest values in an array?
by dubx56
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |