M
Mintcake
I've tried various cloning modules to clone a structure containing weak
references.
use Storable 'dclone';
use Scalar::Util qw(weaken isweak);
my $x = 99;
my $y = [ \$x ] ;
weaken $y->[0];
$z = dclone $y;
print "y: ", isweak $y->[0];
print "z: ", isweak $z->[0];
This prints:
y: 1
z:
I've tried it using the Clone module and Clone:
P. Clone:
P does the
same as Storable. Clone gives a segmentation fault.
I'm using Perl 5.8.0 on Linux 2.4.20-8
references.
use Storable 'dclone';
use Scalar::Util qw(weaken isweak);
my $x = 99;
my $y = [ \$x ] ;
weaken $y->[0];
$z = dclone $y;
print "y: ", isweak $y->[0];
print "z: ", isweak $z->[0];
This prints:
y: 1
z:
I've tried it using the Clone module and Clone:
same as Storable. Clone gives a segmentation fault.
I'm using Perl 5.8.0 on Linux 2.4.20-8