in reply to Hash of Arrays Sorting Problem
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; } } }
use Data::Dumper; print Dumper \%hash;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Hash of Arrays Sorting Problem
by Anonymous Monk on Oct 29, 2002 at 20:50 UTC | |
by kabel (Chaplain) on Oct 29, 2002 at 21:10 UTC |