On Sun, Nov 18, 2001 at 04:33:28AM -0500, Greg London wrote:
> hey, the first version works fine,
> the second version dies a miserable death.
> wassup?????

> # version 2
> our $our_var;
> open ( $our_var, 'junk.pl') or die "OPEN\n";
> while (<$our_var>)
> {
>   my $line = $_;
>   print $_;
> }
> close($our_var);

I don't actually get the miserable death; I get
Use of uninitialized value in <HANDLE> ...

It appears to be an affect of our, which is somehow hiding the variable's
value from the input operator.  If the our is replaced with use vars, then
the code works as expected.  This should be reported as a bug.

Ronald

Reply via email to