Peter Scott schreef:
> Tom Phoenix:

>> In Perl, merely referencing a key
>> in a hash doesn't change the hash. Some non-Perl hash implementations
>> do change the hash in those circumstances, though, so your confusion
>> is understandable.
>
> Not to detract from your point in this thread, but just for the sake
> of completeness, to mention a counterexample corner case:
>
> my %hash;
> foo($hash{bar}{baz});
> print "Oops" if exists $hash{bar};
> sub foo { }

You are not 'merely referencing a key' there, you are using the key, and
then autovivication happens.


> (Any beginners who are way confused by this... you're better off
> forgetting about it until you get heavily into references and lists of
> lists.)

This is a nice article about it:
http://www.sysarch.com/Perl/autoviv.txt

-- 
Affijn, Ruud

"Gewoon is een tijger."



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to