# write.pl my $pid = fork; if($pid == 0) { sleep 5; system('echo "hello world" > foo.txt'); }