> for (my $i = 100; $i < 10000; $i++) { > - return $i if !defined($idlist->{$i}); > + return int($i) if !defined($idlist->{$i}); IMO, this does not solve the problem, because $i is already and int.