summaryrefslogtreecommitdiff
path: root/pod/perlopentut.pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-09-05 04:36:48 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-05 04:36:48 +0000
commit1eb83ea05ee16ff24e004a5f6eb1943faa313a93 (patch)
tree66bd64b7c48f123eda18aa651dd89caad9061844 /pod/perlopentut.pod
parentdd12389b7c5ebc1a14261d71b7d5edca29c6e097 (diff)
downloadperl-1eb83ea05ee16ff24e004a5f6eb1943faa313a93.tar.gz
[perl #3763] code example error in "perlopentut"
p4raw-id: //depot/perl@21040
Diffstat (limited to 'pod/perlopentut.pod')
-rw-r--r--pod/perlopentut.pod4
1 files changed, 2 insertions, 2 deletions
diff --git a/pod/perlopentut.pod b/pod/perlopentut.pod
index f2ba7cdf6c..5389c1f722 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 (<STDIN>) {
- print;
last if --$lines < 0;
+ print;
}
exit;
}