perl -le ' if ($pid=fork) { print "pid: $pid"; exit; } exec ("echo new pid: \$\$"); '