my $highest = 0; foreach my $key (keys %hash) { if ($key > $highest) { $highest = $key; } } print "\nhighest number is: $highest";