On Mon, Jul 14, 2003 at 01:10:59PM -0700, Tim Dolezal wrote: > #!/usr/bin/perl -w > my $line; > open(BAR, ">no-existing-file.$$") || die; > eval { > $line = <BAR> or die; > }; > print STDERR ">>>$@<<<\n"; > close(BAR); > unlink("no-existing-file.$$"); > > > On my machine (perl 5.8.0, Red Hat 9.0 on x86), this results in the > following message: > > Value of <HANDLE> construct can be "0"; test with defined() at test.pl > line 6. > Filehandle BAR opened only for output at test.pl line 6. From perldiag. Value of %s can be "0"; test with defined() (W misc) In a conditional expression, you used <HAN- DLE>, <*> (glob), "each()", or "readdir()" as a boolean value. Each of these constructs can return a value of "0"; that would make the conditional expres- sion false, which is probably not what you intended. When using these constructs in conditional expres- sions, test their values with the "defined" operator. Though it is likely this is a result of Redhat 9 / Unicode damage. Try setting your LANG to C and see if it works. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=87682 -- Do not try comedy at home! Milk & Cheese are advanced experts! Attempts at comedy can be dangerously unfunny!Thread Previous | Thread Next