... $pid = fork() if($pid == 0) { if($command =~ /\&$/) { if(-t STDIN and -t STDOUT) { kill TTOU =>$pid; exec($command); } } else { ... } }