my $min_diff_past = max (@all_date_diffs_past); for my $arr ( @AoA_past ) { if ($arr->[1]==$min_diff_past) { print $arr->[0]."\t"; } }