> how do I differentiate an empty line from end-of-file in perl? Would an
> empty line just equal "\n" and end-of-file equal ""? 

Without knowing how you are processing the file, I know that I generally
find EOF by waiting for a "false" return value from a read call. This
code will read a file until it finds eof and then close the file:

---
while ($line = <SOME_OPEN_FILE>) {
   process_line($line);
}
close SOME_OPEN_FILE;
---

Alternately, the eof() function should work. Just pass the file variable
to the function and it will tell you.

Unless I am mistaken, there is no actual EOF character...it's just
some bit set in a file's state. Anyhow, I hope this helps.

Austin Bingham


---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]

Reply via email to