#!/usr/bin/perl -w use IPC::Run qw(start pump finish timeout); my $tok_program = "/bin/./cat"; my ($TOK_IN, $TOK_OUT, $TOK_ERR); my $TOK = start [$tok_program], 'pty>',\$TOK_OUT, '2>', \$TOK_ERR , debug => 3 or die "Error: $?;\n"; while (my $line = ) { chomp($line); $TOK_IN = $line; $TOK_OUT = ''; $TOK_ERR = ''; print "Input2pump:$TOK_IN\n"; pump $TOK while length $TOK_IN; print "out:$TOK_OUT\n"; }