My most recent was
print printf("%03d\n", $number);
and it took way to long to figure out where the extra
one was coming from.
And another one from a long program that
wrote a bunch of files, but got rid of any empty ones.
# The code as it was executed
open filehandles
print "to file"; # This was anything from
# a few to huge # of items
#cleanup dir
go through directory and unlink any empty files
close filehandles
For some reason if the program didn't have much to say
I'd wind up with fewer files than expected.