|
|
| The stupid question is the question not asked | |
| PerlMonks |
RE: File Input and Outputby Anonymous Monk |
| on May 03, 2000 at 00:57 UTC ( [id://10019]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
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.
In Section
Tutorials
|
|
||||||||||||||||||||||||||||||||