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;