Subject: | Regression in 0.97 |
Consider this code:
#! /usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Clone::Fast qw(clone);
my $comm1 = bless {'name'=>'comm1'}, 'Foo';
my $comm2 = clone($comm1);
$comm2->{name} = 'comm2';
print '$comm1 ('.$comm1.'): '.Dumper($comm1);
print '$comm2 ('.$comm2.'): '.Dumper($comm2);
With version 0.96, this returns the following, as expected:
$comm1 (Foo=HASH(0x152a998)): $VAR1 = bless( {
'name' => 'comm1'
}, 'Foo' );
$comm2 (Foo=HASH(0x1548520)): $VAR1 = bless( {
'name' => 'comm2'
}, 'Foo' );
After upgrading to the latest version, 0.97, I get this output:
$comm1 (Foo=HASH(0xc4d998)): $VAR1 = bless( {
'name' => 'comm2'
}, 'Foo' );
$comm2 (Foo=HASH(0xc6b928)): $VAR1 = bless( {
'name' => 'comm2'
}, 'Foo' );
The problem is that the object is not cloned. It is the same object
returned by clone().
Best,
Florent