vmani_2012 has asked for the wisdom of the Perl Monks concerning the following question:
I ran this simple perl code
use strict; use Devel::Peek; my $a; $a=4; $a eq "13"; $a++; Dump($a); print $a; Dump($a);
when i executed this code, I got the following output
SV = PVIV(0x1a7fd44) at 0x1a716f4 REFCNT = 1 FLAGS = (PADMY,IOK,pIOK) IV = 5 PV = 0x1a63164 "4"\0 CUR = 1 LEN = 12 SV = PVIV(0x1a7fd44) at 0x1a716f4 REFCNT = 1 FLAGS = (PADMY,IOK,POK,pIOK,pPOK) IV = 5 PV = 0x1a63164 "5"\0 CUR = 1 LEN = 12 5
The question here is, Dump($a) before print statement is
PV = 0x1a63164 "4"\0
and after is
PV = 0x1a63164 "5"\0
why the string value (PV) got incremented, any reason?
Back to
Seekers of Perl Wisdom