in reply to Yet Another Unitialized Value Question

The line numbers reported by perl do not always indicate the exact place of the error/warning. An error in a multi-line statement is always reported as if it was on the first line of the statement. In particular, if there is an error in an elsif condition, it is reported with the line number of the corresponding if.

Your if ($lock) should not generate the warning you got, so take a good look at your elsif.

  • Comment on Re: Yet Another Unitialized Value Question

Replies are listed 'Best First'.
Re: Re: Yet Another Unitialized Value Question
by doorslam (Beadle) on Sep 23, 2003 at 10:54 UTC

    Ah, I wondered about that. I thought it might be reporting that line number due to an error inside the if block, did not realize it would report the elsif statements back as that line number. I'll take a look at that.

    Thanks!