"John W. Krahn" wrote:

> open() returns 'true' if the file was opened or 'false' if the file was
> not opened.

Not exactly.  At least not on my Perl installation [5.6.1 on W2K].  open returns 1 on 
success, but does not return a value on failure.

#!/usr/bin/perl -w

use strict;
use warnings;

my $value = open FILE, "values.txm";  # doesn't exist.
print "Value is " . $value . "\n";               #line 9 referenced below
my $line = <FILE>;

Produces:
Use of uninitialized value in concatenation (.) or string at E:\d_drive\perlStuf
f\guests\post_if.pl line 9.
Value is

OTOH, if I correct the filename
my $value = open FILE, "values.txt";
I get
Value is 1

from the same line.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to