Re: print statement creates key in hash with reference to empty array??



>>>>> "r" == rhorizon74 <rhorizon74@xxxxxxxxx> writes:

r> Thanks for the help.
r> That explains what is happening (i had used the exists approach to work
r> around).
r> But it does seem bogus that for a simple print statement i need to
r> check each and every level. I havent seen too many languages do
r> something like this (i may be wrong).
r> But a print statement shouldnt really be creating any data.

if you read my article (which sinan posted the url for) then you will
learn more about autoviv and why it is like it is. and even calling
exists will do the same thing (but that is being fixed in perl6). the
win of autovivication is much greater then the loss of rare code like
yours. if you didn't have it you would need to check each time you used a
reference in structure and either assign a new one or use the existing
one. that is massively ugly and clumsy (and i have seen newbies coding
like that all the time).

uri

--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
.