Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Get your script warnings on the page it generates

by marius (Hermit)
on Jan 18, 2001 at 21:09 UTC ( #52797=note: print w/replies, xml ) Need Help??


in reply to Get your script warnings on the page it generates

Another handy module that takes care of this for you (TMTOWTDI) is CGI::Carp. I've used it quite effectively for debugging in the past. I also like merlyn's idea of having them emailed to you -- I do that with my 404 errors, which gets obnoxious when your friends find out about it ;-)

use CGI::Carp qw(FatalsToBrowser);

-marius

Replies are listed 'Best First'.
Re: Re: Get your script warnings on the page it generates
by chipmunk (Parson) on Jan 18, 2001 at 22:30 UTC
    But warnings aren't fatal...

    use CGI::Carp qw(fatalsToBrowser); will send die/croak/confess messages to the browser, but not warn/carp/cluck messages.

      Good call, chipmunk. I presume you could use carpout() from CGI::Carp to redirect warn/carp/cluck calls to STDOUT.

      Additionally as of CGI::Carp v1.20:
      use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
      With this, you can call
      warningsToBrowser(1)
      to past warnings to the browser after the call.

      Being proven wrong is one of the best reasons to go RTFM, I guess. =]

      -marius

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://52797]
help
Chatterbox?
[Discipulus]: no, they are my crossword/sudoku like entertainment
Discipulus grins
[marto]: Even with shell command recall I find it less time consuming to do such things in a file.
[marto]: I very seldom use one liners for anything which isn't utterly trivial
[Discipulus]: i'm wise enough to never use my oneliners

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2017-09-22 08:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (260 votes). Check out past polls.

    Notices?