in reply to File Input and Output
running this code:
open(FILE, "data.txt"); #opens data.txt in read-mode
while(<FILE>){ #reads line by line from FILE which is the filehandle for data.txt
chomp;
print "Saw $_ in data.txt\n"; #shows you what we have read
}
close FILE; #close the file.
results in:
# perl test1
syntax error at test1 line 5, near "<"
syntax error at test1 line 5, near ">"
Execution of test1 aborted due to compilation errors.
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE: File Input and Output
by turnstep (Parson) on May 03, 2000 at 06:07 UTC | |
by Anonymous Monk on May 05, 2000 at 05:31 UTC | |
by turnstep (Parson) on May 05, 2000 at 06:46 UTC |
In Section
Tutorials