Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 wandering the Monastery: (6)
As of 2015-07-04 13:52 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 (60 votes), past polls