http://qs321.pair.com?node_id=1068433


in reply to Re: Inconsistency of 'Use of uninitialized value in scalar assignment' warning
in thread Inconsistency of 'Use of uninitialized value in scalar assignment' warning

The difference between two foo call cases is evaluation of undefined $baz variable. Isn't it? So we got first warning.

But why we got the second warning? In both cases proxy object must be created and be evaluated during the assignment the same way, and must produce the same warnings.

Replies are listed 'Best First'.
Re^3: Inconsistency of 'Use of uninitialized value in scalar assignment' warning
by dave_the_m (Monsignor) on Dec 26, 2013 at 18:54 UTC
    I think people are still thinking that the second undef warning is due the hash *value* not existing; its not. Both warnings are being generated by trying to evaluate the *key*. In the first foo() call in the OP, the key isn't undef, so it doesn't generate any warnings.

    Dave.