in reply to help with an array of arrays
Since you like List::Util here a more functional approach.
use strict; use warnings; use Data::Dump qw/pp dd/; use List::Util qw(min max); my @AoA = ( ["nick","99"], ["john","88"], ["peter","77"], ["thomas","99"] ); my @numbers=(99, 88, 77, 88); my $max = max(@numbers); pp map { $_->[0] } grep { $_->[1] == $max } @AoA;
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help with an array of arrays
by choroba (Cardinal) on Sep 15, 2018 at 08:51 UTC | |
by LanX (Saint) on Sep 15, 2018 at 09:41 UTC | |
by Anonymous Monk on Sep 16, 2018 at 21:39 UTC | |
by LanX (Saint) on Sep 17, 2018 at 04:04 UTC | |
by AnomalousMonk (Archbishop) on Sep 16, 2018 at 22:45 UTC |