Matt Sergeant wrote:
> Not multiple times, but let them upload and store in a temp file, which
> you can store the filename as a hidden field. Use File::MkTemp to create
> the filenames.
Thanks for the advice, but doesn't File::MkTemp have a race condition?
The subroutine File::MkTemp::mktemp does following (comments are mine):
$keepgen = 1;
while ($keepgen){
# generate a random file name and put it into $template
if ($dir){
$lookup = File::Spec->catfile($dir, $template);
$keepgen = 0 unless (-e $lookup); # isn't it a race?
}else{
$keepgen = 0; # here it doesn't even check -e
}
next if $keepgen == 0; # also, why this check?
}
return($template);
This looks as a bad quality module to me or am I awfully wrong?
(CC: Travis, please don't take it personally)