in reply to Re: Taint error on file upload
in thread Taint error on file upload

%ENV is tainted, meaning $ENV{TEMP} and what not is tainted ...
$ perl -Te "$f=$ENV{TEMP}.q{/junk}; open my($fh), q{>}, $f; " Insecure dependency in open while running with -T switch at -e line 1.

In your program write  $ENV{TEMP}='...'; or untaint the other way