CGI Debugging

This snippet from a thread on PerlMonks:


use CGI::Carp qw(fatalsToBrowser);
use diagnostics;
local $SIG{WARN} = \&Carp::cluck;


and this CGI Help Guide, also on PerlMonks…


#!/usr/bin/perl -wT

# ensure all fatals go to browser during debugging and set-up
# comment this BEGIN block out on production code for security
BEGIN {
$|=1;
print “Content-type: text/html\n\n”;
use CGI::Carp(‘fatalsToBrowser’);
}

along with lots more good tips and tricks on that page.