Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Debugging "Use of uninitialized value" warnings.

by dave_the_m (Parson)
on Apr 04, 2007 at 09:55 UTC ( #608235=note: print w/ replies, xml ) Need Help??


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

This is not currently possible. However, the development version of perl (from 5.9.2 onwards) attempts to determine which variable was undefined; it can't always, as this example shows:

use strict; use warnings; my %foo; my %bar; $bar{'one'} = 1; my ($x,$y); $x = "$bar{'one'} $foo{'one'}"; $x = "$y $foo{'one'}"; $x = "xxx $foo{'one'}"; __END__ Use of uninitialized value in concatenation (.) or string at /tmp/p li +ne 10. Use of uninitialized value $y in concatenation (.) or string at /tmp/p + line 11. Use of uninitialized value in concatenation (.) or string at /tmp/p li +ne 11. Use of uninitialized value $foo{"one"} in concatenation (.) or string +at /tmp/p line 12.
Dave.


Comment on Re: Debugging "Use of uninitialized value" warnings.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-12-25 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls