in reply to Re^3: I have a hash in a hash in a .....
in thread I have a hash in a hash in a .....

Perhaps you could define "read-only", because I can certainly change $r. I can just assign it a new value. I can change the data it points to. None of those things relate to "read-only". It's the conpletely wrong way to think about it.

That $r no longer is a reference when I give it another value doesn't really matter.

--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

Replies are listed 'Best First'.
Re^5: I have a hash in a hash in a .....
by ikegami (Patriarch) on Feb 21, 2006 at 20:57 UTC

    I said the result was read-only. I never said $r was read-only. Oops, I didn't original post, but I did in my second post. Fixed.

    The OP wanted a means of accessing the value at "key" @k.
    Using the "$r" method, one cannot edit the accessed value.
    Using the "$p" method, one can edit the accessed value.

    When something cannot be edited, it is said to be read-only. So while the scalar $r itself is not read-only, the accessed value is read-only.

    Update: Added underlined text.