http://www.perlmonks.org?node_id=608193


in reply to Debugging "Use of uninitialized value" warnings.

use Data::Dumper; print Dumper [ $bar{'one'}, $foo{'one'} ];
will tell you which one is undef.

@_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;

Replies are listed 'Best First'.
Re^2: Debugging "Use of uninitialized value" warnings.
by cwry (Monk) on Apr 04, 2007 at 03:07 UTC

    Thanks, but that's not what I'm after. As I said originally:

    if I receive this warning in a non-trivial program, I can go back and insert some debugging code to check which one of $bar{'one'} or $foo{'one'} is unitialized.

    What I want (as I said), is to have Perl automatically tell me which of the two were uninitialized within the warning, without resorting to inserting additional debug code (as is the case of using Data::Dumper)