in reply to How to get 2nd highest value from an array?
use warnings; use strict; my @list = (4, 7, 1, 3, 2, 9); my $second = (sort @list)[-2]; print $second;
Prints:
7
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to get 2nd highest value from an array?
by Fletch (Bishop) on Dec 14, 2005 at 00:42 UTC |