Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Displaying a variable's name and value in a sub

by trwww (Priest)
on Feb 15, 2011 at 05:56 UTC ( #888126=note: print w/ replies, xml ) Need Help??


in reply to Displaying a variable's name and value in a sub

You have to pass in the variable name:

$ perl -MData::Dumper -Mwarnings -Mstrict -le 'my $quxx = 10; my $foo += {bar => 1, bazz => 2}; print Data::Dumper->Dump([$quxx, $foo], [qw( +quxx foo)]);' $quxx = 10; $foo = { 'bar' => 1, 'bazz' => 2 };


Comment on Re: Displaying a variable's name and value in a sub
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-11-27 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (188 votes), past polls