{ time => $time, conference => $value1, type => $value2, comment => $value3, } #### push @AoH, { time => $t, conference => $v1, ... }; #### my @sorted_AoH = sort { $_->{time} <=> $_->{time} } @AoH; foreach my $conf ( @sorted_AoH ) { my $time = $conf->{time}; print ... # element } #### push @{ $hash{$time} }, { time => $time, type => $v2, ... }; #### for my $time ( sort keys %hash ) { for my $conf ( @{ $hash{ $time } } ) { print ... # $conf element } }