This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix readline example in perlfunc
[perl5.git] / pod / perlfunc.pod
index 826df27..4593352 100644 (file)
@@ -4349,8 +4349,8 @@ steps to ensure that C<readline> was successful.
     for (;;) {
         undef $!;
         unless (defined( $line = <> )) {
     for (;;) {
         undef $!;
         unless (defined( $line = <> )) {
+            last if eof;
             die $! if $!;
             die $! if $!;
-            last; # reached EOF
         }
         # ...
     }
         }
         # ...
     }