my $current = 5; my %hash = ( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five", "8" => "eight" ); while ($current) { $current++; if (exists $hash{$current}) { print "next: $hash{$current}"; last; } } #### my $highest = 0; foreach my $key (keys %hash) { if ($key > $highest) { $highest = $key; } } print "\nhighest number is: $highest";