Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: dumping variables automatically with their name?

by trwww (Priest)
on Mar 25, 2014 at 22:19 UTC ( #1079745=note: print w/replies, xml ) Need Help??


in reply to dumping variables automatically with their name?

I use Data::Dumper->Dump( ARRAYREF, ARRAYREF ). You have to pass in the name, but it gives you what you're asking for:
use warnings; use strict; use Data::Dumper; my @data = (qw(foo bar bazz)); print Data::Dumper->Dump([\@data], ["data"]);
outputs:
$data = [ 'foo', 'bar', 'bazz' ];

Replies are listed 'Best First'.
Re^2: dumping variables automatically with their name?
by LanX (Archbishop) on Mar 31, 2014 at 19:48 UTC
    I knew, thats what I tried to avoid.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-11-16 00:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (192 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!