Beefy Boxes and Bandwidth Generously Provided by pair Networks
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 element

by Fletch (Bishop)
on Jun 22, 2006 at 16:21 UTC ( [id://556939]=note: print w/replies, xml ) Need Help??


in reply to Ref to a list not being equivalent to a list of refs to each element

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://556939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-18 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found