Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://608193]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2016-06-25 08:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (323 votes). Check out past polls.