#!/usr/bin/perl use strict; if (my $pid = fork) { open TTY, "; waitpid $pid, 0; } else { open TTY, ">/dev/tty" or die $!; select TTY; print while <>; }