Clone

 view release on metacpan or  search on metacpan

t/14-weakened-ref.t  view on Meta::CPAN

    if ($@) {
        plan skip_all => "Scalar::Util::weaken not available";
        exit;
    }
}

plan tests => 16;

# GH #15 - Weakened refs always clone as undef
# When cloning a structure with weakened references, Clone should
# preserve the weakness and keep referents alive when strong
# references to them exist elsewhere in the clone graph.

{
    package Parent;
    sub new { bless { children => [] }, shift }

    package Child;
    sub new {
        my ($class, $parent) = @_;
        my $child = bless { parent => $parent }, $class;



( run in 1.668 second using v1.01-cache-2.11-cpan-39bf76dae61 )