Fix for doc bug #8602 : clarify eof() example comments
Rafael Garcia-Suarez [Fri, 9 May 2003 19:47:49 +0000 (19:47 +0000)]
p4raw-id: //depot/perl@19465

pod/perlfunc.pod

index b7c1aaf..44a6f28 100644 (file)
@@ -1329,12 +1329,11 @@ last file.  Examples:
 
     # insert dashes just before last line of last file
     while (<>) {
-       if (eof()) {            # check for end of current file
+       if (eof()) {            # check for end of last file
            print "--------------\n";
-           close(ARGV);        # close or last; is needed if we
-                               # are reading from the terminal
        }
        print;
+       last if eof();          # needed if we're reading from a terminal
     }
 
 Practical hint: you almost never need to use C<eof> in Perl, because the