How to reassign DB::OUT?

Discussion in 'Perl Misc' started by J Krugman, Feb 26, 2004.

  1. J Krugman

    J Krugman Guest

    I have a huge data structure in the perl debugger, which I can view
    with the x command. I would like to save the output of the x
    command to a file. I thought that one way to do this would be to
    reassign DB::OUT, but all my effort to do this have failed. How
    can I reassign DB::OUT so that commands like 'x $foo' print to a
    file?

    Thanks,

    jill
     
    J Krugman, Feb 26, 2004
    #1
    1. Advertising

  2. [A complimentary Cc of this posting was sent to
    J Krugman
    <>], who wrote in article <c1loa7$ghg$>:

    > I have a huge data structure in the perl debugger, which I can view
    > with the x command. I would like to save the output of the x
    > command to a file. I thought that one way to do this would be to
    > reassign DB::OUT, but all my effort to do this have failed. How
    > can I reassign DB::OUT so that commands like 'x $foo' print to a
    > file?


    The simplest hack is to reset $ENV{PAGER} and do `|x $foo'... But
    personally, I would just call Dumpvar.pm manually...

    Hope this helps,
    Ilya
     
    Ilya Zakharevich, Feb 27, 2004
    #2
    1. Advertising

  3. J Krugman

    J Krugman Guest

    In <c1n3m9$o9d$> Ilya Zakharevich <> writes:

    >[A complimentary Cc of this posting was sent to
    >J Krugman
    ><>], who wrote in article <c1loa7$ghg$>:


    >> I have a huge data structure in the perl debugger, which I can view
    >> with the x command. I would like to save the output of the x
    >> command to a file. I thought that one way to do this would be to
    >> reassign DB::OUT, but all my effort to do this have failed. How
    >> can I reassign DB::OUT so that commands like 'x $foo' print to a
    >> file?


    >The simplest hack is to reset $ENV{PAGER} and do `|x $foo'...


    I settled for a similar hack (O pager='> myfile', etc.).

    >But
    >personally, I would just call Dumpvar.pm manually...


    Yes, that's an alternative, but dumpvar.pm is not documented, and
    I have a hard time figuring out what the code does. What sub(s)
    from dumpvar.pm would you call to get the same output as you'd get
    from

    |x $mongo_data_structure

    jill
     
    J Krugman, Feb 27, 2004
    #3
  4. [A complimentary Cc of this posting was sent to
    J Krugman
    <>], who wrote in article <c1o66r$b0h$>:
    > >But
    > >personally, I would just call Dumpvar.pm manually...

    >
    > Yes, that's an alternative, but dumpvar.pm is not documented


    Oups, it should have been Dumpvalue.pm.

    Yours,
    Ilya
     
    Ilya Zakharevich, Feb 27, 2004
    #4
  5. J Krugman

    J Krugman Guest

    In <c1o8gn$139l$> Ilya Zakharevich <> writes:

    >[A complimentary Cc of this posting was sent to
    >J Krugman
    ><>], who wrote in article <c1o66r$b0h$>:
    >> >But
    >> >personally, I would just call Dumpvar.pm manually...

    >>
    >> Yes, that's an alternative, but dumpvar.pm is not documented


    >Oups, it should have been Dumpvalue.pm.


    That's great! I much prefer the formatting of Dumpvalue.pm over
    the one produced by Data::Dumper.

    Thanks!

    jill
     
    J Krugman, Feb 27, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VGltOjouLg==?=

    Reassign value to private

    =?Utf-8?B?VGltOjouLg==?=, Jan 27, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    383
    =?Utf-8?B?VGltOjouLg==?=
    Jan 27, 2005
  2. biswaranjan.rath

    how to reassign variable

    biswaranjan.rath, May 5, 2006, in forum: XML
    Replies:
    3
    Views:
    7,828
    biswaranjan.rath
    May 5, 2006
  3. Shailesh Humbad

    reassign keys in an STL map

    Shailesh Humbad, Oct 29, 2004, in forum: C++
    Replies:
    7
    Views:
    2,627
    Greg Schmidt
    Nov 2, 2004
  4. Bernhard Merkle

    reassign to builtin possible !?

    Bernhard Merkle, Jan 3, 2008, in forum: Python
    Replies:
    8
    Views:
    309
    Bernhard Merkle
    Jan 4, 2008
  5. Immortal Nephi

    Reassign two objects to one pointer?

    Immortal Nephi, May 19, 2009, in forum: C++
    Replies:
    1
    Views:
    322
    Bart van Ingen Schenau
    May 20, 2009
Loading...

Share This Page