$ 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.
In reply to Re: Getting an unknown error
by ikegami
in thread Getting an unknown error
by andybshaker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |