On Tue, May 25, 2004 at 10:29:04AM -0000, Lionel CONS wrote:
> Some old code of mine stopped working on recent versions of Perl.
> After debugging, the problem seems to be in some incompatibility
> between Carp and Safe.
Thanks for the report.
Carp will sometimes do:
{ local $@; require Carp::Heavy; }
Since require isn't allowed within the compartment, Perl raises an exception;
control is unwound to the eval done by the Safe::reval, then all the saved
stuff like the local()s are unwound, thus blowing away the error message
in $@.
A similar result can be seen with this:
sub foo {
print("starting foo\n");
{ local $@; require XXX; }
print("exiting foo\n");
}
$| = 1;
eval("foo()");
die("trapped: [[$@]]\n") if $@;
print "at end\n";
which outputs:
starting foo
at end
As to how to fix this, or whether it needs fixing, I don't know. Anyone
else want to voice their opinions?
--
You never really learn to swear until you learn to drive.
Thread Previous
|
Thread Next