http://qs321.pair.com?node_id=218443


in reply to Re: Detecting a failed DBI connection
in thread Detecting a failed DBI connection

I'm just wondering as to whether your way of printing out errors to the browser is efficient. For starters, this is really just reinventing the fatalsToBrowser method provided by the CGI::Carp module. I could understand this if maybe you didn't want all errors to be outputted to the user's browser. But even at this point, you'd have to make sure that HTTP headers have already been sent to the browser, otherwise your code would just damage the output. If you're set on using this, maybe a subroutine call would be more appropriate, so that you can later change the error handling behaviour. Besides, then you won't have ugly exit() calls hanging around everywhere :)

mt2k -> must try 2 know