Subject: | Clone::clone on shared data causes crash |
Date: | Wed, 12 Mar 2014 22:13:01 -0700 |
To: | bug-Clone [...] rt.cpan.org |
From: | Jim Avera <james_avera [...] yahoo.com> |
Hi,
I'm trying to use Clone::clone to copy a hash which is shared among threads,
but when the result is accessed, Perl dies with
"Can't locate object method "FETCH" via package "threads::shared::tie"
at ..."
Here's an example:
#!/usr/bin/perl
use strict; use warnings;
use threads;
use threads::shared;
use Clone;
my $a = shared_clone { foo => 100, bar => 200 };
my $b = Clone::clone($a);
print $b->{foo}, "\n"; #crashes here
-Jim