Subject: | Can't locate loadable object for module main::Tie::Hash::NamedCapture |
Date: | Wed, 20 Jun 2012 12:42:46 +0300 |
To: | bug-Safe [...] rt.cpan.org |
From: | Julian Lishev <julian.lishev [...] imperia.bg> |
Snippet to demonstrate the bug:
#!/usr/bin/perl
use strict;
BEGIN {
use Safe;
my $safe = Safe->new;
}
use English;
# or just ...
# *+;
In Perl 5.14 Tie::Hash::NamedCapture is loaded dynamically (see
perldelta for 5.14). Probably this is the change that affects this bug:
"The bulk of the |Tie::Hash::NamedCapture| module used to be in the Perl
core. It has now been moved to an XS module to reduce overhead for
programs that do not use |%+| or |%-| ."
The fix for this issue is just to access *+ before calling Safe->new:
use Safe;
*+;
my $safe = Safe->new;
This bug was reproduced on:
Ubuntu 11.04, Perl 5.14.2
and
Windows 7 SP1, ActiveState Perl 5.14.2