in reply to Re: Setting In-between values in a hash (interpolating)
in thread Setting In-between values in a hash (interpolating)

No need to sort
sub next_key { my ($h, $key) = @_; my $best; foreach my $hkey (keys %$h) { if ( $hkey >= $key ) { if ( !defined($best) || $hkey < $best ) { $best = $hkey; } } } return $best; }