in reply to Creating a file in a CGI script...
What's sometimes helpful to debug this type of problem is to monitor the server logs as you use the script. So if its a Unix box and Apache do a
tail -f /usr/local/apache/logs/access.log
or similiar. If its a busy production server, (maybe you should'nt be using it for devel work), you can always grep for your script.
On NT, if God-help-us, you are using IIS, then logfiles default to
\Winnt\system32\LogFiles\W3SVC3\
RE: Re: Creating a file in a CGI script...
by perlcgi (Hermit) on May 20, 2000 at 18:08 UTC
|
Of course even simpler than monitoring the logs file is to use CGI::carp
From the CGI::Carp doc:
By default, error messages are sent to STDERR. Most HTTPD servers direct STDERR to the server's error log. Some applications may wish to keep private error logs, distinct from the server's error log, or they may wish to direct error messages to STDOUT so that the browser will receive them.
| [reply] |
|
Just put the following line near the start of your file, and you'll receive fatal error messages (from die -- you are using die, aren't you?) in your web browser. No need to tail -f the logs with:
use CGI::Carp qw(fatalsToBrowser);
| [reply] [d/l] |
|