in reply to Re: Get hash value with the lowest key
in thread Get hash value with the lowest key

Thanks, Foxcub!

But would I be able to get to the key as well? As I was waiting for solutions, I came up with the following:

my @sorted = sort keys %$href; my $value = $href->{$sorted[0]}; %$href = (); $href->{$sorted[0]} = $value;
It gets me what I was looking for but is there a better way to do it?