gibsonca has asked for the wisdom of the Perl Monks concerning the following question:
Generally I can find and fix a problem like this. But this time it seems like something else is involved. The message, in the title of this post, appears from only line 123, and not on the previous lines. I do this same type of 'if' in other places with no messages. When I copy the code to a small test case, it works fine. I have verified with the debugger and print statements that the variables involved are defined. for ($sdd=0; $sdd <= $#gSDDdata; $sdd++) { # foreach SDD for ($srs=0; $srs <= $#gSRSData; $srs++) { # foreach SRS if (not defined $gSDDdata[$sdd]{source}) { print "m \n"; } elsif (not defined ($gSRSData[$srs]{sect})) { print "n \n"; } if ($gSDDdata[$sdd]{source} =~ /$gSRSData[$srs]{sect}/) { # <- 123 $gSRSData[$srs]{found} = $gSDDdata[$sdd]{found} = 1; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use of unintialized value in pattern match (m//) at x.pl line 123
by linuxer (Curate) on May 14, 2009 at 21:51 UTC | |
by gibsonca (Beadle) on May 14, 2009 at 22:20 UTC | |
by gibsonca (Beadle) on May 15, 2009 at 20:26 UTC | |
|
Re: Use of unintialized value in pattern match (m//) at x.pl line 123
by graff (Chancellor) on May 15, 2009 at 21:17 UTC |