Skip Menu |

This queue is for tickets about the Safe CPAN distribution.

Report information
The Basics
Id: 72872
Status: resolved
Priority: 0/
Queue: Safe

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Safe vs Tie::Hash::NamedCapture
Date: Fri, 02 Dec 2011 07:22:20 +1100
To: bug-Safe [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
In recent debian i386 perl 5.14.2, if a safe compartment has been created then a subsequent use of the "%-" named capture gets an error. For example use Safe; Safe->new; unless (eval '$-{foo}; 1') { print "error:\n", $@; } prints error: Can't locate loadable object for module main::Tie::Hash::NamedCapture in @INC where I hoped that creating (and destroying) a safe would not affect what is done outside it subsequently. The "eval" here is just to delay the $-{foo} use until after a safe is created. It can also be provoked with use Safe; BEGIN { Safe->new } $-{foo} This seems to be something to do with perl 5.14, as this sort of thing (much bigger) was working for me in 5.12. A workaround is to "use Tie::Hash::NamedCapture" before creating a safe compartment, but dunno if that module is supposed to be for public use.
This bug is solved in Safe 2.30, just uploaded to CPAN. The relevant patch is here : http://perl5.git.perl.org/perl.git/commitdiff/ad084f51cd17539ef55b510228156cd4f83c9729