IO::Tty and IO::Pty provide an interface to pseudo-ttys.