use strict; use warnings; use diagnostics; my @aoh; push @aoh, { "start" => .4, "stop" => .6, "step" => .1 }; push @aoh, { "start" => .3, "stop" => .5, "step" => .1 }; push @aoh, { "start" => .0, "stop" => .2, "step" => .1 }; push @aoh, { "start" => .5, "stop" => .7, "step" => .1 }; my $aoh = \@aoh; for my $point ( @{$aoh}) { #for my $type ( sort keys %$point ) { for my $type ( sort by_pref keys %$point ) { print "$type\t"; } print "\n"; } sub by_pref { $a cmp $b; #advice? }