* Steffen Schwigon <[EMAIL PROTECTED]> [2006-05-24 15:05]:
> "A. Pagaltzis" <[EMAIL PROTECTED]> writes:
> > Err I think you misread my mail. I meant that the code
> > modifies the hash, but does nothing to modify the reference,
> > so there is no need to make the reference read-write.
> 
> In my understanding, the '->' makes an alias to the elements of
> the hash, which is different from being a reference. And the
> "is rw" modifies that alias (the loop element).
> 
> You are right, in that the "is rw" shouldn't be needed because
> the loop element alias should be "rw" by default. Which in turn
> it isn't, because of the pugs bug.

You are still missing the point.

In Perl 5 terms:

    use Readonly;
    Readonly::Scalar my $hashref => {};
    $hashref->{foo} = 1; # does not die

The read-only variable here is a reference to a hash. I can
freely modify the *hash*, regardless of whether the *reference*
to it is readonly or not.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Reply via email to