$ perl -le '$num=0; if (fork) { while(1) { print "Elter: ", ++$num; sleep 1 } } else { while(1) { print "Kind: ", ++$num; sleep 1 } }' Elter: 1 Kind: 1 Elter: 2 Kind: 2 Elter: 3 Kind: 3 ^C