Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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

by ikegami (Patriarch)
on Aug 09, 2020 at 21:07 UTC ( #11120527=note: print w/replies, xml ) Need Help??

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

Since making the scalar read-only doesn't prevent transformation (only assignment), there is no backwards compatibility issue relating to transformation.

Hence it's far more likely that legacy code will break if something like $_++ became illegal for an aliased input like 3+4 .

And that's exactly what the change is suppose to prevent. What's the point of making the change if it doesn't prevent exactly what it's suppose to be preventing!

If you say there's no point in preventing $_ = ... when $_ is an unassigned string, then there's no point in preventing it when it's an unassigned reference.

Replies are listed 'Best First'.
Re^11: Shouldn't references be readonly? (updated)
by LanX (Sage) on Aug 09, 2020 at 23:45 UTC
    I'm giving up.

    I once vowed to avoid diving deeper than Re^10 and here we are! :)

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2023-06-11 01:36 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (40 votes). Check out past polls.