in reply to Safe, namespaces, B::Deparse
This is a problem if you completely discard Safe as well. Try your same snippet with a plain eval and see where that gets you - exactly nowhere. If you're going to start using eval that way then you'll want to alter your code generation accordingly to add the package in. You know the right package when you generate the code - just stick it in there as well.
my $s = sub { eval qq/package @{[__PACKAGE]}; print "PACKAGE is ",__PACKAGE__,"\n";/; die $@ if $@; };
__SIG__ use B; printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Safe, namespaces, B::Deparse
by djantzen (Priest) on Oct 31, 2002 at 10:36 UTC | |
by diotalevi (Canon) on Oct 31, 2002 at 13:30 UTC | |
by djantzen (Priest) on Oct 31, 2002 at 22:36 UTC |