Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: When aliasing sub arguments to @_ elements, PADTMP, READONLY flags are copied inconsistently

by vr (Curate)
on Jan 20, 2020 at 18:59 UTC ( [id://11111641]=note: print w/replies, xml ) Need Help??


in reply to Re: When aliasing sub arguments to @_ elements, PADTMP, READONLY flags are copied inconsistently
in thread When aliasing sub arguments to @_ elements, PADTMP, READONLY flags are copied inconsistently

Thank you all for useful links and answers, I should have done better research to at least find ref to read-only alias ... why?, which itself links far further into the past. Still not sure how to justify why with foo(1+1) the $_[0] is OK to be writeable, but with foo(1) it should die. Following previous discussion, the impression now is that it's either not a bug but vague (because of dynamic language(?)) area, or bug of very low priority, fixing of which can break/slower existing code (?).

As to from where I started (foo(pack 'P', $data)), with hindsight, of course $_[0] is "pointable" for as long as staying within a sub, and returning that pointer to outside is entirely programmer's (my) fault, Perl couldn't help :(

  • Comment on Re^2: When aliasing sub arguments to @_ elements, PADTMP, READONLY flags are copied inconsistently
  • Select or Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-25 20:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found