Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^8: Shouldn't references be readonly? (updated)

by LanX (Sage)
on Aug 05, 2020 at 21:41 UTC ( #11120367=note: print w/replies, xml ) Need Help??


in reply to Re^7: Shouldn't references be readonly? (updated)
in thread Shouldn't LITERAL references be readonly? (updated)

> But regardless of that, there is still the question of whether the reference returned by [] and {} should be marked readonly. I suppose it could be but Larry never thought to do so,

Thanks, at least someone beside Hauke who is not trying to convince me that the issue doesn't exist at all. \o/

> and there doesn't seem any point in changing it now.

Well ... catching errors would be an issue, don't you think?

But like always with old errors, I wouldn't surprised if they became "features".

After changing, some CPAN modules might break because they did something like

sub func { $_[0] //= { the_default => "values" }; ... }

which is a broken approach to default values ...

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2021-12-01 06:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?