Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: allowing Data::Dumper within safe.pm

by Anonymous Monk
on Feb 12, 2013 at 09:17 UTC ( #1018319=note: print w/ replies, xml ) Need Help??


in reply to allowing Data::Dumper within safe.pm

Question: What should I allow to make Data::Dumper work? I tried permit("eval") but it says no operator recognized

Mwaaah?

Following http://search.cpan.org/dist/Safe/Safe.pm#permit_%28OP,_...%29 says to see http://search.cpan.org/~dom/perl-5.12.5/ext/Opcode/Opcode.pm#Predefined_Opcode_Tags, search for eval, i see entereval and leaveeval -- so try something from that list :)

I assume you can always http://search.cpan.org/dist/Safe/Safe.pm#share_from_%28PACKAGE,_ARRAYREF%29 Dumper


Comment on Re: allowing Data::Dumper within safe.pm
Re^2: allowing Data::Dumper within safe.pm
by gideondsouza (Pilgrim) on Feb 12, 2013 at 09:34 UTC

    Ah! I've tried entereval and leaveeval and it still gives me the exact same message! :(

    How should I use share_from, I don't quite understand what it does!

      share() allows you to specify which global variables in your program that you want your compartment to be able to see. However, you can only specify simple names, like '$x', i.e. names from the current namespace.

      share_from() allows you to specify more complex variable names, i.e. variables from a different namespace, e.g. package X::Y::Z.

      However, I've not succeeded in getting either to work. If you do, please post an example.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-07-29 23:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls