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

Re^2: RFC: Data::Dumper::Simple

by Ovid (Cardinal)
on Aug 01, 2004 at 00:27 UTC ( [id://379000]=note: print w/replies, xml ) Need Help??


in reply to Re: RFC: Data::Dumper::Simple
in thread RFC: Data::Dumper::Simple

That fails because eval is limited to the current lexical scope, hence Aristotle's suggestion to use PadWalker.

do { my @array = ( qw/foo bar/ ); print MyDumper(qw/@array/); }; sub MyDumper { my @values; for (@values = @_) { s/^([%@])/\\$1/; $_ .= ','; } my @names; for (@names = @_) { s/^[%@]/*/; s/^\$//; } + return eval "use Data::Dumper;Data::Dumper->Dump([@values],[qw/@na +mes/])"; }

Cheers,
Ovid

New address of my CGI Course.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-25 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found