Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: RFC: Data::Dumper::Simple

by NetWallah (Canon)
on Jul 31, 2004 at 16:43 UTC ( #378939=note: print w/replies, xml ) Need Help??


in reply to RFC: Data::Dumper::Simple

Wonderful! - I always hated the 2 issues with Data::Dumper - it wants a REFERENCE, and it wont easily tell you the variable NAME.

There was one additional nit - which perhaps you can pick -the need to say "print Dumper (\$blah)" - why keep repeating the "print" or "warn" .. wouldn't is be nice to have an OO interface that remembers what you want to do .. something like:

use Data::Dumper::Simple; my $Dump => new Data::Dumper::Simple( Output=>"warn", # or "print" # or: Output=\&CodeRef vars=($this,%that,@other) }; $Dump->() ; # Can't think of appropriate syntax here.. # Line above would do the equivalent of print Dumper ($$this,%that,@other); # If we no longer want to output %that, do $Dump->Removevars(%that); # or even $Dump->Addvars(@Something_Else);

    Earth first! (We'll rob the other planets later)

Replies are listed 'Best First'.
Re^2: RFC: Data::Dumper::Simple
by Ovid (Cardinal) on Aug 04, 2004 at 16:04 UTC

    There was one additional nit - which perhaps you can pick -the need to say "print Dumper (\$blah)" - why keep repeating the "print" or "warn" .. wouldn't is be nice to have an OO interface that remembers what you want to do.

    The latest version of Data::Dumper::Simple supports this.

    use Data::Dumper::Simple autowarn => 1; Dumper($scalar, @array, %hash);

    Or if you'd rather carp and you're already using a sub named Dumper:

    use Data::Dumper::Simple as => 'show', autowarn => 'carp'; show($scalar, %hash);

    There's not much of a savings if you're doing this just once, but if you are doing a lot of debugging, it can save quite a bit of time.

    Cheers,
    Ovid

    New address of my CGI Course.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-04-23 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?