From: Jarkko Hietaniemi Date: Fri, 5 Sep 2003 04:36:48 +0000 (+0000) Subject: [perl #3763] code example error in "perlopentut" X-Git-Tag: v5.10.0~9101 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/1eb83ea05ee16ff24e004a5f6eb1943faa313a93?ds=sidebyside [perl #3763] code example error in "perlopentut" p4raw-id: //depot/perl@21040 --- diff --git a/pod/perlopentut.pod b/pod/perlopentut.pod index f2ba7cd..5389c1f 100644 --- a/pod/perlopentut.pod +++ b/pod/perlopentut.pod @@ -625,11 +625,11 @@ just in a different process: sub head { my $lines = shift || 20; - return unless $pid = open(STDOUT, "|-"); + return if $pid = open(STDOUT, "|-"); # return if parent die "cannot fork: $!" unless defined $pid; while () { - print; last if --$lines < 0; + print; } exit; }