Unless your hash is huge (like, tens of thousands of keys), it will almost definately be faster to sort the keys each time you want to access it rather than keep a tied hash (or some other custom datatype) in the sort order that you want.my %hash; # use the hash like normal - perl will keep it in whatever # order is the most useful for the runtime foreach my $key (sort keys %hash) { print $hash{$key}; }
In reply to Re: Hash sorting
by aufflick
in thread Hash sorting
by pickledegg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |