in reply to Re: iterating through a 2 dimensional hash
in thread iterating through a 2 dimensional hash
That is, it could only be helped if you take the trouble to specify a non-canonical order external to the hash, e.g.:
or assign sortable values within the hash (which could be worked into the hash-creation process):my @key1_order = qw/AB PL B/; ... foreach my $key1 ( @key1_order ) { ... }
$coord_{AB}{order} = 1; $coord_{PL}{order} = 2; $coord_{B}{order} = 3; ... foreach my $key1 ( sort { $coord_{$a}{order} <=> $coord_{$b}{order} } +keys %coord_ ) { ... }
|
|---|