Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
And it dies with "nope!". So far I've found one package on CPAN, "OOPS", that has planned support for serialzing weak references, but nothing currently exists... or maybe something does?use strict; use Storable qw(freeze thaw); use Scalar::Util qw(weaken isweak); # make a circular reference, then weaken it my $a={}; $a->{a}=\$a; weaken($a->{a}); # looks like we're ok isweak($a->{a}) || die; # serilize it my $b=freeze($a); # and unpack it my $c=thaw($b); # check if the weak reference survived the freeze isweak($c->{a}) || die "nope!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: serializable weak references
by perrin (Chancellor) on May 19, 2004 at 17:00 UTC | |
|
Re: serializable weak references
by halley (Prior) on May 20, 2004 at 13:51 UTC |