in reply to Re^4: Shouldn't references be readonly?
in thread Shouldn't LITERAL references be readonly? (updated)
Isn't an alias something dereferenced into a symbol table entry? So a reference and an alias are on different levels of indirection.
DB<1> use Scalar::Util 'readonly' DB<2> p readonly 1 134217728 DB<3> p readonly \1 0 DB<4> *one = \1 DB<5> p readonly $one 134217728 DB<6> $rone = \1 DB<7> p readonly $$rone 134217728 DB<8> $one = 2 Modification of a read-only value attempted at (eval 16)[/usr/share/pe +rl/5.20/perl5db.pl:732] line 2. DB<9> $$rone = 2 Modification of a read-only value attempted at (eval 17)[/usr/share/pe +rl/5.20/perl5db.pl:732] line 2.
Greetings,
-jo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Shouldn't references be readonly?
by LanX (Saint) on Aug 05, 2020 at 18:20 UTC | |
by jo37 (Deacon) on Aug 05, 2020 at 18:40 UTC | |
by LanX (Saint) on Aug 05, 2020 at 18:53 UTC | |
by jo37 (Deacon) on Aug 05, 2020 at 19:21 UTC | |
by haukex (Archbishop) on Aug 05, 2020 at 20:30 UTC | |
by LanX (Saint) on Aug 05, 2020 at 19:31 UTC | |
|
In Section
Seekers of Perl Wisdom