in reply to confusing fork/readline behaviour
perl -e ' my $pid = fork(); open X, "</etc/passwd"; while (readline(X)){ print "$$: $_"; sleep 1 } print "$$: all done\n"; waitpid $pid, 0 if $pid; '
One world, one people
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: confusing fork/readline behaviour (wait)
by tye (Sage) on Aug 14, 2015 at 14:18 UTC | |
by anonymized user 468275 (Curate) on Aug 14, 2015 at 18:55 UTC | |
|
Re^2: confusing fork/readline behaviour
by roboticus (Chancellor) on Aug 14, 2015 at 14:29 UTC | |
by anonymized user 468275 (Curate) on Aug 14, 2015 at 19:01 UTC |