in reply to split and sort functions
Perhaps you do want your hash to be automatically sorted. In that case, you might be interested in something that works like a hash, but internally keeps the keys sorted, something like a binary search tree. I don't know immediately of something that you could use instead of a hash, but perhaps, assuming your hash keys are always integers, a Judy Array might work for you. There's an XS implementation for Perl in Tie::Judy. The docs there say: "the keys here are in bit-wise SORTED order".
|
|---|