in reply to Re^2: Shouldn't references be readonly?
in thread Shouldn't LITERAL references be readonly? (updated)
That seems to be because a reference to a literal actually constructs a new scalar; note that the examples you gave where an error was thrown at an attempt to modify a read-only value did not involve references, but only aliases to literal values. I suspect that the anonymous scalar you get when you say \1 is probably modifiable. There is no such thing as a literal aggregate in Perl — the {} and [] operators are defined as constructors instead.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Shouldn't references be readonly?
by LanX (Saint) on Aug 05, 2020 at 21:56 UTC | |
by hippo (Bishop) on Aug 05, 2020 at 22:07 UTC | |
by jcb (Parson) on Aug 05, 2020 at 22:01 UTC | |
by LanX (Saint) on Aug 05, 2020 at 22:11 UTC | |
by jcb (Parson) on Aug 05, 2020 at 22:18 UTC |
In Section
Seekers of Perl Wisdom