my @keys = grep { defined $hash{$_} || $_ eq $key } sort keys %hash;
I am too tired at the moment (just started a new job) to actually write this code, but the binary search should be noticeably faster on large hashes especially if the target key is not at the beginning. If you are interested I will update it later.
Cheers - L~R
In reply to Re: retrieve next avaiable element in sorted hash
by Limbic~Region
in thread retrieve next avaiable element in sorted hash
by vinforget
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |