Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Ref to a list not being equivalent to a list of refs to each elementby Fletch (Bishop) |
on Jun 22, 2006 at 16:21 UTC ( [id://556939]=note: print w/replies, xml ) | Need Help?? |
OK, only a shot in the dark after playing with B::Concise and B::Deparse but here goes . . . In the first and third cases the reference is to a readonly PV value. This is copied directly into the SV slot of *a and when you try and modify it you get the error. In the middle case either a non-readonly copy of the PV is pushed onto the stack, or the make-reference-to-list opcode (refgen I think) makes a non-readonly copy. Whichever case it is, the PV that's stuck in the SV slot of *a is mutable.
In Section
Seekers of Perl Wisdom
|
|