Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Echoing on screen
by pg (Canon) on Dec 14, 2002 at 05:26 UTC
    • print? (is this too obvious?)
    • Carp?
    • check Data::Dumper, for complex structures
    • check Devel::Peek, for what's going on behind each variables
    • Do you really want to print things on screen? it might just comes and goes. If later you change your mind, do something like:
      open(STDOUT, ">", stdout.txt); open(STDERR, ">", stderr.txt);
    • so you haven't tried perl -d? well, try it
Re: Echoing on screen
by FamousLongAgo (Friar) on Dec 14, 2002 at 05:34 UTC
    I like to use warn ( or carp ) since that lets me easily separate the debugging output from the program output when running on the command line.

      I agree to a certain extent, for instance when piping the different outputs to files. But in some situations if the os doesnt handle its buffering properly (Win32 doest always seem to) the output can be intermixed in ways that make it hard to see the time sequence of the output. So I've found that often its best to stick with just plain old print.

      --- demerphq
      my friends call me, usually because I'm late....

Re: Echoing on screen
by MarkM (Curate) on Dec 14, 2002 at 05:31 UTC
    I think you are looking for something like the Perl interactive debugger, or the Active State Perl IDE environment with integrated debugger. Since I don't use either, I'm sorry, but I cannot be of more help. Good luck!

      I'm a heavy user of the ActiveState KOMODO IDE. There is a free version to try and I think it works very well (not only for Perl, but also for XML, XSLT, HTML, PHP, ...).

      It integrates the PERL-debugger and shows your output in a scrollable window.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law