On Sun Sep 19 12:17:11 2010, sprout wrote:
> On Sun Sep 19 12:13:48 2010, sprout wrote:
> > package Readonly::Alias;
> > sub TIESCALAR { bless \(my $x = \pop) }
> > sub FETCH { $${$_[0]} }
> > sub STORE { die "Assignment to read-only value" }
> > package main;
> > tie $alias, "Readonly::Alias", $var;
> > $var = *foo;
> > print $alias; # prints *main::foo
> > # Now modify a glob slot, not the alias itself:
> > *$alias = []; # bang
> >
> > I don’t think assignment *through* a glob should count as assignment
> > to the glob itself. So there’s no need to call set-magic in this case.
>
> Here is a patch.
Applied as cffb36981555.