in reply to Re: Tracking down uninitialized values...
in thread Tracking down uninitialized values...

You're right. On many that I've been fixing I was able to use the line number to fix it, however, this one has me stumped so I intentionally left out the additional info it gives in hopes of finding general answers for how to track them down vs. this specific instance. Though since I've mentioned it now, here's the full message: "Use of uninitialized value in join or string at (eval 39) line 15."

Thanks for the quick response!
  • Comment on Re^2: Tracking down uninitialized values...

Replies are listed 'Best First'.
Re^3: Tracking down uninitialized values...
by jhourcle (Prior) on Jul 28, 2006 at 16:32 UTC

    You have to figure out what the 39th call to eval is, and look at line 15 in it:

    use warnings; foreach my $i ( 1..5, undef, 7..9 ) { eval '$x = join("",$i,"");'; } # Use of uninitialized value in join or string at (eval 6) line 1.
Re^3: Tracking down uninitialized values...
by philcrow (Priest) on Jul 28, 2006 at 17:14 UTC
    If you don't have a good line number, start putting warn statements in the code. Their output will go to standard err just like the uninitialized value warnings, so they will appear in sequence with the problem. By knowing which warns come before and after the one you are tracking, you can locate it.

    Phil

    Update: corrected to show warn goes to stderr, thanks Hue-Bond.