Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I want to use LWP::Simple inside a safe compartment created with the Safe Module. But it ends up with errors like "Can't locate object method "new" via package "LWP::UserAgent" at line... or "Require trapped by operation mask..."
Here is how the code looks like (shortened ;-) ):
(There is a reason why I use "wget" instead of "get" directly because I have already a subroutine with the name "get" elsewhere)$codefromoutside='print wget "http://google.com";'; use LWP::Simple (); sub wget { LWP::Simple::get $_[0] } use Safe; $safe=new Safe; $safe->share(qw(wget)); $safe->reval($codefromoutside); print $@ if $@;
I tried some other things but they all didn't work. Does anybody know how to use LWP::Simple::get inside a save compartment?
Thanks in advance,
best regards,
Christoph Bergmann
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to use LWP::Simpe inside a safe compartment?
by jlongino (Parson) on Nov 23, 2001 at 00:18 UTC | |
by Anonymous Monk on Dec 07, 2001 at 05:23 UTC | |
by Anonymous Monk on Aug 01, 2007 at 17:52 UTC |
Back to
Seekers of Perl Wisdom