Gunnar Hjalmarsson wrote:
JupiterHost.Net wrote:
If the script is called via the command line I'd rather not output HTML
Why would you want to use CGI::Carp at all if you call a program from the command line? This is a solution I have applied:
BEGIN { if ($ENV{GATEWAY_INTERFACE}) { require CGI::Carp; import CGI::Carp 'fatalsToBrowser'; } }
Isn't it rather the Carp module you should use otherwise, if anything?
Thanks Gunner, probably should be carping it, although I think the $SIG{__DIE__} is more what I need for command line stuff.
Or just not do anything with it if -t STDIN and let die take its nature course, no pun intended sort of :)
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>