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

katgirl has asked for the wisdom of the Perl Monks concerning the following question:

How can I make sure that when people upload files, they always have a different name, so that they don't wipe off the old file? Is this a good way:
#$imagename is name of file $num=0; while(-e "$Data/$category/$imagename"){ $num++; $imagename=$imagename$num; }
My brain is starting to fizz. Please help, oh lovely fellow monks!