in reply to Getting an unknown error
$ perl -MDevel::Peek \ -e'$x="abc"; Dump($x); Dump($1); for $1 ($x) { Dump($1); }' SV = PV(0xd0e9e0) at 0xd2b810 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0xd33f20 "abc"\0 CUR = 3 LEN = 10 COW_REFCNT = 1 SV = PVMG(0xd23870) at 0xd36138 REFCNT = 1 FLAGS = (GMG,SMG) IV = 0 NV = 0 PV = 0 MAGIC = 0xd44e10 MG_VIRTUAL = &PL_vtbl_sv MG_TYPE = PERL_MAGIC_sv(\0) MG_OBJ = 0xd36120 MG_LEN = 1 SV = PV(0xd0e9e0) at 0xd2b810 REFCNT = 2 FLAGS = (POK,IsCOW,pPOK) PV = 0xd33f20 "abc"\0 CUR = 3 LEN = 10 COW_REFCNT = 1
Before the loop, the symbol $1 accesses the scalar at address 0xd36138.
Inside the loop, the symbol $1 accesses the scalar at address 0xd2b810, which is the same scalar accessed by $x.
The read-only property of $1 is a property of the scalar. At your own request, you are not accessing that scalar within the body of the loop.
The capture fetching property of $1 is a property of the scalar. At your own request, you are not accessing that scalar within the body of the loop.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting an unknown error
by oiskuu (Hermit) on Apr 24, 2015 at 17:15 UTC | |
by ikegami (Patriarch) on Apr 27, 2015 at 01:18 UTC |