develooper Front page | perl.perl5.porters | Postings from July 2001

Re: taking a reference is an assignment?

Thread Previous
From:
hv
Date:
July 28, 2001 13:51
Subject:
Re: taking a reference is an assignment?
Message ID:
200107282049.f6SKnX301108@crypt0.demon.co.uk
Jeffrey Friedl <jfriedl@yahoo-inc.com> wrote:
:Does anyone know why the code to take a reference of a hash's key,
:
:    \$hash{KEY}
:
:results in the MOD flag on to the 'helem' at #6 below:

I think it is to force autovivification of the key, on the grounds that
you can't take a reference to something that doesn't exist yet.

Hugo

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About