Just a note:
warningsToBrowser(1) must be explicitly called after printing the page header, and will output all warnings as HTML comments. It's its difference from
fatalsToBrowser, which catches all fatal errors (even compile-time!) without any additional actions. The
CGI::Carp documentation contains additional info.
UPD: i haven't seen the previous reply while writing this :)