in reply to Re: Re: Re: Autovivification not working?
in thread Autovivification not working?

--, ++, -=, += and friends shouldn't complain about undefined variables, according to documentation.

But you aren't using a variable, you are using a tied hash. I don't have the right modules installed, so try using B::DeParse to see what perl is doing to your program. <BS mode on> I haven't checked this but I bet perl is turning your 'variable' into a function call to something like (I last read the tie page many moons ago) $resolve->STORE('this one does not exist', $resolve->FETCH('this one does not exist') + 2)  <BS mode off>

Let me know what it B::DeParse does to your code - I'm interested.

Read more about tied hashes here.

____________________
Jeremy
I didn't believe in evil until I dated it.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Autovivification not working?
by Juerd (Abbot) on Dec 20, 2001 at 20:04 UTC
    Had tried that before, but B::Deparse doesn't turn hash operations on tied hashes into their corresponding method calls. But since there's no tie method for +=, I guess your explanation must be right.

    Thanks!

    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$