John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:

If I wanted to add things like print "I'm here! $val" to code to begin to figure out what is going wrong in code that's part of a HTML::Mason application, where can I send output so I can see it?

—John

Replies are listed 'Best First'.
Re: Mason - debug output?
by tilly (Archbishop) on Jul 15, 2008 at 00:45 UTC
    Print to STDERR and look in your web server's error logs.

    If there is too much other junk in there, then open up a log file and write to that instead. Oh, and clean up your error log. Error logs are supposed to be fairly clean so that you can notice errors.

Re: Mason - debug output?
by Cody Pendant (Prior) on Jul 15, 2008 at 06:55 UTC
    You can put it anywhere you like and output it to the browser as long as you have a print "Content-type: text/html\n\n"; before it. It won't look pretty because there'll probably be another one further down the page, but it'll work.


    Nobody says perl looks like line-noise any more
    kids today don't know what line-noise IS ...