THANKS!! this is great, i can get what i needed, i'm able to read through line by line what are the outputs. However, how will i be able to output the stream in real time while i'm collecting the data in CIN? Otherwise i'll have to flush out all outputs at one shot when the plink process is done? for this example, i'll use "ls" :
my $command = 'link -ssh -pw password_here user_name@host -batch';
$pid= open3(\*CIN, \*COUT, \*COUT, $command);
print CIN "ls\n";
print CIN "exit\n";
close CIN;
my @xs = <COUT>;
foreach $x(@xs)
{
print "\noutput:".$x."\n";
}
close COUT;
waitpid( $pid, 0 );