in reply to RE: Order a hash?
in thread Order a hash?

Out of mild curiosity, does Perl do any caching of a sort keys %hash call, or do you have to do that yourself? (And if so, when does it become worth it? How many repeated calls of sort keys %hash does it take until my @sortedkeys = sort keys %hash becomes a worthwhile use of memory? 1? 2? Never? I don't think that I've ever written a script that needed to sort the same thing more then once, and if I did I probably cached the results in an array first, but I'm wondering if Perl does any optimization there...