in reply to Re^5: Don't treat your numbers as strings, or Interpolation is worse than you might think
in thread Don't treat your numbers as strings, or Interpolation is worse than you might think
You see—the PV (value of the string) for $x was not updated by the numeric operation and was not copied to $y. So, being strict, the variables after numification become not pure IV, but PVIV storing only integer, looking much like simple IV, which causes much less work to copy :)perl -MDevel::Peek -e'$x = 3; qq($x); $x+=1; Dump $x; $y=$x; Dump $y' SV = PVIV(0x15d75f4) at 0x15d57e4 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 4 PV = 0x1a53acc "3"\0 CUR = 1 LEN = 2 SV = PVIV(0x15d7604) at 0x15d64d4 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 4 PV = 0
|
|---|