in reply to Re: hash ordered by an array
in thread hash ordered by an array

i agree completely, if you would like to have particulary orderd structure of data it is better to use @arrays they have indexes that sorts your data in particular way , %hashes are special for their keys that are associated with some value. i mean, you could sort those keys like this:
sort keys %hash;
but to do it in a particular order you would somehow have to index those keys. top of the head solution;
%hash = ('dog' => 1, 'big' => 5, 'jak' => 4, 'mack' => 19); @array = qw(dog mack jak big); foreach $val (@array){ print "$hash{$val}\n"; }
in this way you are doing, in a particular order something with your %hash values. i suppose this isn't exactly what you had in mind but...