in reply to Finding Previous and Next in a HASH

Well, here's my attempt, assuming that $current holds the value of the current key:
my ($previous,$next); my @keys = sort { $a <=> $b } keys %hash; for (my $i=0; $i < scalar @keys; $i+=1) { $previous = $keys[$i-1] unless $i == 0; $next = $keys[$i+1] unless $i == scalar @keys; last if $keys[$i] == $current; }

Alan "Hot Pastrami" Bellows

Update: Oh, this also assumes that the value of $current is known to be in %hash, if a value is in $current that is not in %hash it won't work too good.