in reply to mkpath (and rmtree) throw strange error when used in CGI
It'd likely be more helpful if you actually showed the text you're getting... without that, I just have to imagine it.
Most likely problem in CGI when dealing with the filesystem is write/execute permission. Remember that the CGI app is usually not running as your user, but as whatever apache drops privileges to (apache and nobody are common choices, but could be anything). So if that user doesn't have permission to make the directory, it will fail.
What you are probably seeing is mkpath's failure. According to the docs, it'll use Carp::croak - so trap it with eval:
But that's just a guess.unless (eval { mkpath($dir); 1 }) { show_error_page("Couldn't create $dir: $@"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: mkpath (and rmtree) throw strange error when used in CGI
by ibmman (Novice) on Feb 10, 2009 at 22:17 UTC | |
by Anonymous Monk on Feb 11, 2009 at 08:30 UTC |