"be consistent" | |
PerlMonks |
Re^7: Warnings not being thrown with DBI (nits)by tye (Sage) |
on Sep 11, 2005 at 21:27 UTC ( [id://491109]=note: print w/replies, xml ) | Need Help?? |
It isn't assigning to $href->{id}, it is assigning to a magic "alias" (at a distance) which autovivifies the key and value pair. I especially consider it autovivification because the assignment creates the key even though the key is not mentioned in the assignment code. I also consider it autovivification because it is just a special (delayed) case of the following: To show the autovivification of a hash entry more clearly, just do \$hash{id} (using a hash entry in an lvalue 'context'). Or, to be closer to the original code, consider
Which hasn't (yet?) been made to delay the autovivification step like was done for function arguments. - tye
In Section
Seekers of Perl Wisdom
|
|