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; }
In reply to Re^2: Setting In-between values in a hash (interpolating)
by ikegami
in thread Setting In-between values in a hash (interpolating)
by ravishi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |