Posted on 2009-01-29 21:08:15-08 by masterchief007
Scalar that is PVIV thaws as PV
This is probably a newbie-level question, but if I use Devel::Peek to look at a PVIV scalar before and after it is thawed, it is PV after it thaws:

################
use Devel::Peek;
use Storable qw(freeze thaw);

my $a = 1000;
my $tmp = $a . "\n"; # only done to coerce into a SvPVIV
Dump($a);
my $meat = thaw(freeze(\$a));
Dump($$meat);
################

The output is:
################
SV = PVIV(0x9fcf778) at 0xa00611c
REFCNT = 1
FLAGS = (PADMY,IOK,POK,pIOK,pPOK)
IV = 1000
PV = 0x9fe0adc "1000"\0
CUR = 4
LEN = 8
SV = PV(0xa08fad4) at 0xa1f5504
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0xa0c93a4 "1000"\0
CUR = 4
LEN = 8
################

Is this the expected behavior for Storable, or should the PVIV be restored when thawed?

Thanks!

--
Eric
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.