http://www.perlmonks.org?node_id=874090


in reply to Renaming an image file

Why not avoid all the potential (though unlikely) issues of non-unique pseudo-random numbers and hash collisions - just use the start time of the script ($^T) as a base index, and increment from there. And if you restart the script, it won't collide with any names from before.