=> 10);
$c = clone($o);
isnt $c, $o;
$c->{foo}++;
is $o->{foo}, 10, 'clonable';
$o = MyCustomClonable->new(foo => 10);
$c = clone($o);
isnt $c, $o;
$c->{foo}++;
i
o);
isnt $c, $o;
$c->{foo}++;
is $o->{foo}, 10, 'clonable';
usleep 10;
$o = MyCustomClonable->new(foo => 10);
$c = clone($o);
isnt $c, $o;
tie %h, 'MyClonableHash';
$h{foo} = 42;
$h{bar} = "xyzzy";
$c = clone(\%h);
isnt $c, \%h;
$c->{foo}++;
is Dumper($c), Dumper({ foo => 43, bar => "xyzzy" });
is Dumpe
() = (1)x100000; # extend the stack
return []
}
}
my $before = bless [], Bar::;
my $after = clone($before);
isnt $after, $before, 'stack reallocation during callback';
done_testing;