use warnings; use strict; my @list = (4, 7, 1, 3, 2, 9); my $second = (sort @list)[-2]; print $second;
Prints:
7
In reply to Re: How to get 2nd highest value from an array?
by GrandFather
in thread How to get 2nd highest value from an array?
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |