in reply to A somewhat unexpected side effect...
The more technical reason is "you get normal increment if the SV isn't a PV".
As you can see, the variable does change by just looking at it.perl -MDevel::Peek -e '$n = "z"; Dump($n); $f = 3 + $n; Dump($n)' SV = PV(0x804def8) at 0x8063ad0 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x805cce8 "z"\0 CUR = 1 LEN = 2 SV = PVNV(0x8080dc0) at 0x8063ad0 REFCNT = 1 FLAGS = (IOK,NOK,POK,pIOK,pNOK,pPOK) IV = 0 NV = 0 PV = 0x805cce8 "z"\0 CUR = 1 LEN = 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A somewhat unexpected side effect...
by blazar (Canon) on Nov 22, 2006 at 16:14 UTC |