in reply to Single step debugging a CGI in a browswer

CGI::Carp may be useful, this captures die() and warn() messages & displays them in the page (i.e. to your browser).

just another cpan module author