in reply to Example for EOF
I'm not sure what the problem is, exactly. Do you want to just know when the program has finished reading?
use strict; use warnings; my $file = "file.txt"; open FH, "<", $file; while(<FH> { # do something here... } print "End of file has been reached\n";
I think that ought to do it for you, though I haven't actually tested the code.
|
|---|