Filed under:

Perl script error "CGI open of tmpfile: Permission denied" on Windows hosting.




Perl script error "CGI open of tmpfile: Permission denied"

With perl for windows sometimes the TMPDIR environment variable does not get set to the correct value. To work around this issue you can set the TMPDIR variable to be the same as TEMP using code similar to that shown below.
BEGIN { if ($^O =~ /MSWin32/i) { $ENV{'TMPDIR'}=$ENV{'TEMP'}; } } use CGI; 


Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
article icon Where is perl located? (Views: 1317)

Language: