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

I would like to capture the output from the command below to a file on linux, centos 5.3. Is there a way? DB<9> x $self->{data_hash} I have tried perl -d myscript.pl | tee output.txt. I don't see a way listed with the 'h' or 'h h' help options.
  • Comment on Perl Debugger capturing output from the 'x' command while in a debug session

Replies are listed 'Best First'.
Re: Perl Debugger capturing output from the 'x' command while in a debug session
by BrowserUk (Patriarch) on Apr 17, 2009 at 00:11 UTC
Re: Perl Debugger capturing output from the 'x' command while in a debug session
by quester (Vicar) on Apr 16, 2009 at 22:33 UTC
    I'm not in a place where I can test this, but try:
    script -c 'perl -d myscript.pl' logfile.txt
    It will log the whole debugging session.
      Yes, this works! Thanks. It would still be interesting to see if you could capture just that single 'x' command output only.
Re: Perl Debugger capturing output from the 'x' command while in a debug session
by repellent (Priest) on Apr 17, 2009 at 00:11 UTC
    The Perl debugger uses prints like Dumpvalue.
    > perl -MDumpvalue -e ' $d = Dumpvalue->new(); $d->dumpValue([ 1, 2, { a => 3, b => 4, c => 5 } ])' > out.txt

    Update: Well, the debugger actually tries to use dumpvar.pl
Re: Perl Debugger capturing output from the 'x' command while in a debug session
by linuxer (Curate) on Apr 16, 2009 at 22:27 UTC

    As I have no experience with the debugger, I cannot give a direct solution; sorry.

    Have a look at perldebug and try out the NonStop and LineInfo options (as bart and jvector already mentioned in the CB). Don't know if you already checked that.

    Let's hope you get additional answers from more experienced "debuggers" ;o)