[Pdx-pm] Data::Dumper::Simple

Ovid publiustemp-pdxpm at yahoo.com
Wed May 18 08:41:20 PDT 2005


--- Josh Heumann <perl-pm at joshheumann.com> wrote:
> Ovid, I like the concept of Data::Dumper::Simple, but from an
> interface
> standpoint, it was a little confusing.  This is how I use
> Data::Dumper:
> 
> use Data::Dumper;
> 
>                                                                      
>          my
> $foo
> =
> 42;
> print Dumper $foo;
> 
> ...but Data::Dumper::Simple doesn't work the same way.  In order to
> use
> it, I have to do this:
> 
> use Data::Dumper::Simple;
> 
> my $foo = 42;
> warn Dumper( $foo );
> 
> It's a small difference, I know, but it would be really nice to just
> substitute one for the other and have my existing print statements
> work.
> 
> Any specific reason for not allowing the print Dumper?

You can "print Dumper($data)" all you want.  The caveats to remember
with Data::Dumper::Simple is that you must be dumping variables (not
subroutine calls) and you have to use the parenthesis.  You can print,
warn, diag, etc., all you want.  Your print example failed to work
because you didn't use parentheses.

Cheers,
Ovid

-- 
If this message is a response to a question on a mailing list, please send
follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/


More information about the Pdx-pm-list mailing list