Anonymous
public text v1 · immutablefor ( my $i=1; $i<=4; $i++ ) {
if ( my $pid = fork ) {
# this is parent process
die "fork: $!" unless defined $pid;
}
}
# this is child process
sleep 10;
for ( my $i=1; $i<=4; $i++ ) {
if ( my $pid = fork ) {
# this is parent process
die "fork: $!" unless defined $pid;
}
}
# this is child process
sleep 10;