Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 };

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 chanting in the Monastery: (6)
As of 2016-06-30 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (388 votes). Check out past polls.