in reply to A somewhat unexpected side effect...

You put the emphasis on the wrong part of the quoted documentation. The essential part is has ever been used in a numeric context. Either side of binary + is classifies as numeric context.

The more technical reason is "you get normal increment if the SV isn't a PV".

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
As you can see, the variable does change by just looking at it.

Replies are listed 'Best First'.
Re^2: A somewhat unexpected side effect...
by blazar (Canon) on Nov 22, 2006 at 16:14 UTC
    You put the emphasis on the wrong part of the quoted documentation. The essential part is has ever been used in a numeric context. Either side of binary + is classifies as numeric context.

    Indeed that would have been right part to explain the difference re what happens when you uncomment the line with the binary +: in fact it's the one quoted by the author of the original article. (But I didn't want to repeat). However the one I emphasized did apply to what I was discussing around that point i.e. why ++($f='z') is 'aa' and ++($f='9') is 10.