You could try using the confess method in Carp.
Also, CGI::Carp exists for use in CGI environments.
In reply to Re: stack dump quest by thedoe in thread stack dump quest by EchoAngel