This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix readline example in perlfunc
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 15 Jun 2009 14:16:17 +0000 (16:16 +0200)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 15 Jun 2009 14:18:11 +0000 (16:18 +0200)
Only check $! if an error was encountered (that is, not at end of file)

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 = <> )) {
+            last if eof;
             die $! if $!;
-            last; # reached EOF
         }
         # ...
     }