Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

DumperX

by tame1 (Pilgrim)
on Apr 08, 2002 at 20:23 UTC ( [id://157539]=perlquestion: print w/replies, xml ) Need Help??

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

Does anyone know of a handy-dandy HOWTO for Data::Dumper::DumperX?

The perldoc isn't exactly clear, and I know what I need -
I always want my complex hash done up as a one line, one var ($VAR1 = )
text line. No \n's, no indents, etc. As I said, the perldoc is a little
shy on HOWTO type help.

What does this little button do . .<Click>; "USER HAS SIGNED OFF FOR THE DAY"

Replies are listed 'Best First'.
Re: DumperX
by tachyon (Chancellor) on Apr 08, 2002 at 20:43 UTC
    @struct = ( { foo => 'bar'}, [ 1,2,3 ], 4,5,6 ); use Data::Dumper; for $i (0..3) { $Data::Dumper::Indent = $i; print Dumper(\@struct),"\n\n"; }

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: DumperX
by ozone (Friar) on Apr 08, 2002 at 20:48 UTC
    { local $Data::Dumper::Indent = 0; Dumper($myVar); }

    Pretty much verbatim from the Data::Dumper perldoc.

Just remember, it's Dump, not dump :)
by RMGir (Prior) on Apr 08, 2002 at 21:23 UTC
    Just remember not to confuse Data::Dumper->Dump, and dump.

    I misremembered how to use Data::Dumper once, and wrote something like:

    use Data::Dumper; my $a; # build up complex thingy in $a # dump it out to try to debug what's wrong with it print dump($a);
    Took me quite a while to realize that Data::Dumper wasn't what was core dumping my program, the dump built-in was... :)
    --
    Mike

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found