Closed p5pRT closed 14 years ago
I submitted a bug about Safe.pm breakage that had several overlapping problems\, but there seems to be a basic problem with using 'use' in a Safe at all. Here's the most minimal test case I could come up with:
#!/usr/bin/perl
use Safe;
$s = new Safe; $s->deny_only(qw(:base_math)); # dummy deny\, we're not using any math
$s->reval(q[use FileHandle;]); $@ and die "can't use:\n$@ $!";
outputs the following:
can't use: Can't locate object method "unimport" via package "strict" at /usr/local/lib/perl5/5.6.0/FileHandle.pm line 46. BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.6.0/FileHandle.pm line 46. Compilation failed in require at (eval 2) line 1. BEGIN failed--compilation aborted at (eval 2) line 1. at ./ts2.pl line 10.
various attempts to work around this problem in the module I'm actually using elsewhere\, Template.pm (which gets pretty much the same errors) by creating an instance outside the safe then sharing it pretty much dies the moment it tries to create new instances\, like Template::Exception. Besides\, if my users in this template system can't use 'use'\, then I may as well forget it.
was pondering going back to perl5.004_05\, but it doesn't even compile.
Rereported as https://rt.cpan.org/Ticket/Display.html?id=56515
-- Alexandr Ciornii\, http://chorny.net
@chorny - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#3342 (status was 'resolved')
Searchable as RT3342$