argv has asked for the wisdom of the Perl Monks concerning the following question:
use CGI::Carp qw(fatalsToBrowser);
to redirect errors to the browser. I want to use the same modules in my tty-oriented scripts too. But when I do, errors are reported with HTML tags embedded...
I understand why, of course, but there's another curiosity about this: because I use carpout() in my set_message() function to redirect error output to another file, perl complains that the file is non-existent when used from the tty scripts. (It works just fine from the cgi scripts.)
I would prefer that Carp somehow be more intelligent about what to output if STDOUT is a tty, but barring that, how can I conditionally choose to use CGI::Carp in the perl module that contains it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to conditionally use CGI::Carp?
by jhourcle (Prior) on May 06, 2005 at 02:39 UTC | |
by argv (Pilgrim) on May 06, 2005 at 03:57 UTC | |
by argv (Pilgrim) on May 06, 2005 at 05:05 UTC | |
|
Re: How to conditionally use CGI::Carp?
by Errto (Vicar) on May 06, 2005 at 03:26 UTC | |
by argv (Pilgrim) on May 06, 2005 at 04:24 UTC | |
by perrin (Chancellor) on May 06, 2005 at 20:47 UTC | |
|
Re: How to conditionally use CGI::Carp?
by tilly (Archbishop) on May 07, 2005 at 05:15 UTC |