Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

RE: Data::Dumper (Adam: Sample Usage)

by Adam (Vicar)
on Oct 27, 2000 at 23:00 UTC ( #38864=note: print w/ replies, xml ) Need Help??


in reply to Data::Dumper

I'm always forgeting the way to get Data::Dumper to print a hash and put the name of the hash in-place of the "$VAR". So this is as good a place as any to stick it where I can find it quickly, and other people can see an example usage.

use strict; use Data::Dumper; my %hash = ( 'some' => 'stuff' ); print Data::Dumper->Dump([\%hash], ["hashname"]), $/;


Comment on RE: Data::Dumper (Adam: Sample Usage)
Download Code
Re: RE: Data::Dumper (Adam: Sample Usage)
by dkubb (Deacon) on Jan 18, 2001 at 06:24 UTC

    Here's an example of how I use Data::Dumper, on one line, during debugging. It produces a pretty clean output of the data structure:

    print Data::Dumper->new([\%hash],[qw(hash)])->Indent(3)->Quotekeys(0)->Dump;
Reaped: Re^2: Data::Dumper (Adam: Sample Usage)
by NodeReaper (Curate) on Apr 22, 2014 at 06:01 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2015-07-07 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls