Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Perl Debugger capturing output from the 'x' command while in a debug session

by x5150 (Acolyte)
on Apr 16, 2009 at 22:23 UTC ( #758086=perlquestion: print w/ replies, xml ) Need Help??
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
Re: Perl Debugger capturing output from the 'x' command while in a debug session
by linuxer (Deacon) 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)

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 BrowserUk (Pope) on Apr 17, 2009 at 00:11 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://758086]
Approved by linuxer
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2014-07-28 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (194 votes), past polls