perhaps this gets you started:
use strict;
use warnings;
my %hash = (
sorter1 => {
domain1 => [
123,
124,
112,
110,
],
},
);
foreach my $sorter (keys %hash) {
print "\n\nSORTER=$sorter";
foreach my $domain (keys %{$hash{$sorter}}) {
my $current = 0;
my $show_max = 2;
foreach my $time (reverse sort @{$hash{$sorter}{$domain}}) {
print "\nDomain=$domain, Time=$time";
(++ $current >= $show_max) and last;
}
}
}
always use strict and warnings. you can dump arbitrary data structures with the Data::Dumper module.
use Data::Dumper;
print Dumper \%hash;