http://qs321.pair.com?node_id=1222401

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks.
Assume the following code:
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);

I want to print both "nick" and "thomas", since they both have 99, how do I do that? I tried the following, but it prints them twice (obviously):
for my $i ( 0 .. $#AoA ) { for my $j ( 0 .. $#{$AoA[$i]} ) { if ($AoA[$i][1]==$max) { print $AoA[$i][0]."\n"; } } }