use IO::Select; open ENGINE_READ,"engine.exe |"; my $timeout=10; $s = IO::Select->new(); $s->add(\*ENGINE_READ); @ready = $s->can_read($timeout);