in reply to How do I get output from the perl debugger (perl -d) into a text file?

if you are on a unix machine, something like perl -d myprogram.pl | tee logfile.log writes the output from perl into the logfile, but not your input.
maybe that helps.
  • Comment on Re: How do I get output from the perl debugger (perl -d) into a text file?

Replies are listed 'Best First'.
Re^2: How do I get output from the perl debugger (perl -d) into a text file?
by tphyahoo (Vicar) on Aug 01, 2005 at 12:52 UTC
    Okay... tee for windows is downloadable at http://unxutils.sourceforge.net/. I'm trying it out now... and..

    It doesn't quite work. tee does print out to that log file, but it only seems to be printing what normally would be coming out of stdout. Perhaps if I could trap the stderr stuff into tee I would get the debug output as well. Any ideas?

      I'd recommend the unix 'script' command, but be warned -- it will also save control characters, which makes for some interesting reading if you try to pop it open in your favorite text editor.

      You can clean up a script file using the unix command 'col'.

      You can also use logging in your terminal program (tf or similar, if your current terminal doesn't support that function) or use something like 'screen'.

      Update: For those who aren't aware, windows users can make use of unix commands via programs like cygwin. Another useful command.com replacement is 4DOS and its siblings.

        open DB::OUT, ">&STDOUT"

        Do that after you've started the debugger (piped through tee) but before you've done anything too insteresting.

        - tye