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.