my ($readHandle, $writeHandle) = (IO::Handle->new, IO::Handle->new); my $pid = open2($readHandle, $writeHandle, @command); $readHandle->autoflush(1); $readHandle->blocking(0); $writeHandle->autoflush(1); $writeHandle->blocking(0);