Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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

Replies are listed 'Best First'.
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
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)

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?
[Yaerox]: I feel like i'm not seeing the forest for the trees. Can someone give me a hint how to research converting all kinds of files into ansi? If origin file is utf8 convert to ansi, is origin file is ansi then skip file.
[1nickt]: Yaerox probably best to whip up an SSCCE demonstrating the failure in what you have now and post to SoPW as a question.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2017-03-28 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (331 votes). Check out past polls.