open my $tty, "<", "/dev/tty" or die; while (<$tty>) { chomp; print "Read '$_' from the terminal\n"; }