This test only passes in 5.10.0+ because of a nasty bug in Hash::Util,
or perhaps Internals::SvREADONLY.
lock_hash is supposed to lock values as well as keys, but it doesn’t
always in 5.10.0+, leading me to believe that it was the right func-
tion to use. (Fixing that is for another commit.)
use vars qw($canonical $forgive_me $VERSION);
-$VERSION = '2.29';
+$VERSION = '2.30';
BEGIN {
if (eval { local $SIG{__DIE__}; require Log::Agent; 1 }) {
use Storable qw(dclone freeze thaw);
-use Hash::Util qw(lock_hash unlock_value);
+use Hash::Util qw(lock_hash unlock_value lock_keys);
use Test::More tests => 104;
my %hash = (question => '?', answer => 42, extra => 'junk', undef => undef);
my %hv;
$hv{a} = __PACKAGE__;
- lock_hash %hv;
+ lock_keys %hv;
my $hv2 = &$cloner(\%hv);
ok eval { $$hv2{a} = 70 }, 'COWs do not become read-only';
}