#!/usr/bin/perl use strict; use warnings; use IO::Pty::HalfDuplex; my $pty = IO::Pty::HalfDuplex->new; $pty->spawn("nethack") or warn "Spawn failed: $!"; unless ( $pty->is_active ) { warn "$pty is not active"; } else { print $pty->recv; }