in reply to Re: Question on SV internals
in thread Question on SV internals
Yes, until you next use it in a string context.
There's no such terminating condition.
>perl -MDevel::Peek -e"$_ = '20 ducks'; Dump($_); 0+$_; Dump($_); ''.$ +_; Dump($_);" ... SV = PVNV(0x163a454) at 0x342be4 REFCNT = 1 FLAGS = (POK,pIOK,pNOK,pPOK) IV = 20 NV = 20 PV = 0x1639b14 "20 ducks"\0 CUR = 8 LEN = 12
Another way to check is to count the number of numeric warnings:
>perl -wE"$_='20 ducks'; say 0+$_; say 0+$_; say ''.$_; say 0+$_;" Argument "20 ducks" isn't numeric in addition (+) at -e line 1. 20 20 20 ducks 20
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Question on SV internals
by BrowserUk (Patriarch) on May 08, 2011 at 16:42 UTC | |
by ikegami (Patriarch) on May 08, 2011 at 16:47 UTC | |
by BrowserUk (Patriarch) on May 08, 2011 at 19:09 UTC | |
by ikegami (Patriarch) on May 08, 2011 at 23:53 UTC |