Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Debugging "Use of uninitialized value" warnings.

by f00li5h (Chaplain)
on Apr 04, 2007 at 03:02 UTC ( #608193=note: print w/replies, xml ) Need Help??

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)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://608193]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2017-12-13 04:50 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (345 votes). Check out past polls.