develooper Front page | perl.perl5.porters | Postings from July 2012

[perl #113894] Storable can't store VSTRINGs

Thread Previous | Thread Next
Father Chrysostomos via RT
July 30, 2012 23:35
[perl #113894] Storable can't store VSTRINGs
Message ID:
On Thu Jun 28 21:43:30 2012, sprout wrote:
> On Thu Jun 28 20:32:02 2012, wrote:
> >   use Storable 'dclone'
> >   my $copy = dclone(\v1.2.3);
> >   is(ref($copy), 'VSTRING');
> > 
> > This fails, because Storable serializes the vstring as just a normal
> >    string.
> > I've already added a TODO test for this in the Storable test suite.

I’ve fixed it with commits e00e3c3ee and 7e2a0d4586.

> In case you are planning to fix this, you might want to look at commit
> d036e907fea, which added vstring support to Data::Dumper.  Vstrings have
> been a bit buggy in earlier versions of perl (and Storable is
> dual-life).  In particular, ~v0 returns a scalar with vstring magic
> attached to it when it shouldn’t.  Data::Dumper detects that and treats
> it as not-a-vstring.

That did not actually matter, as Storable can store both the PV and the
magic PV, so what comes back is identical.

Data::Dumper can only store one (either "\1\2\3" or v1.2.3), so it has
to choose based on whether they actually match.


Father Chrysostomos

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About