Subject: | Re: STORABLE_attach bug |
Date: | 25 Sep 2006 10:28:08 +0100 |
To: | bug-Storable [...] rt.cpan.org |
From: | Terry Glanfield <terry.glanfield [...] printsoft.com> |
Sorry, I ought to know better:
Storable version 2.15
perl --version
This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 25 registered patches, see perl -V for more detail)
Copyright 1987-2006, Larry Wall
Binary build 817 [257965] provided by ActiveState http://www.ActiveState.com
Built Mar 20 2006 17:54:25
Terry Glanfield <terry.glanfield@printsoft.com> writes:
Show quoted text
> Dear Sir/Madam.
>
> Here is a diff to t/attach_singleton.t that demonstrates that an
> object stored twice in the same structure comes back as two different
> objects. I believe it is not being properly cached; STORABLE_attach
> is only called once during the thaw process. If you also put other
> data in the object then only the first copy with still contain it.
>
> Regards,
> Terry.
>
> 26c26
> < use Test::More tests => 11;
> ---
> > use Test::More tests => 16;
> 58a59,64
> >
> > # test multiple instances
> > $struct = [ $object, $object ];
> > $frozen = Storable::freeze( $struct );
> > $thawed = Storable::thaw( $frozen );
> > is( "$thawed->[0]", "$thawed->[1]", 'Multiple Singletons thaw correctly' );
>