On Wed, 20 Sep 2000, Steve Fink wrote:

> 1 my ($x, $y, $z);
> 2 $z = 1;
> 3 my $logfile = "/tmp/log";
> 4 $x = 1 if cond();
> 5 print $x+$y;
> 6 undef $z;
> 7 print $z;
> 
> --> use of uninitialized variable $y in line 5 (compile time)
> --> possible use of uninitialized variable $x in line 5 (compile time)
> --> variable $logfile defined in line 3 but never used (compile time)
> --> use of undefined value in line 7 (run time)


        Couldn't the error on line 7 be detected at compile time as well?
After all, there is no execution path which will result in $z having a
defined value.

                                        Dave

Reply via email to