Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

RE: File Input and Output

by Anonymous Monk
on May 03, 2000 at 04:57 UTC ( #10019=note: print w/ replies, xml ) Need Help??

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.

Comment on RE: File Input and Output
Replies are listed 'Best First'.
RE: RE: File Input and Output
by turnstep (Parson) on May 03, 2000 at 06:07 UTC
    root just forgot that you don't need to escape less-than and greater-than signs inside <CODE> tags. Obviously, it should read:

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://10019]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2015-10-09 21:19 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (252 votes), past polls