Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; 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);
for my $i ( 0 .. $#AoA ) { for my $j ( 0 .. $#{$AoA[$i]} ) { if ($AoA[$i][1]==$max) { print $AoA[$i][0]."\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help with an array of arrays
by Paladin (Vicar) on Sep 14, 2018 at 23:19 UTC | |
by Anonymous Monk on Sep 14, 2018 at 23:22 UTC | |
|
Re: help with an array of arrays
by LanX (Saint) on Sep 15, 2018 at 00:18 UTC | |
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 |