# starting the application my $handle = start \@args, \$in, \$out, \$err; #### my ($in, $out, $err); for($in,$out,$err) { $_ = \my $x } # starting the application my $handle = start \@args, $in, $out, $err; # wait until prompted for input pump $handle until $$out =~ /Login:/; # note the dereferencing - $$out $in .= "Boris\n"; # wait until prompted for password pump $handle until $$out =~ /Password:/; # and so on ... # store them $client_descr->{"Handle"} = $handle; $client_descr->{"In"} = $in; $client_descr->{"Out"} = $out; $client_descr->{"Err"} = $err; #### $in .= "new data\n"; pump $handle until $$out =~ /data arrived:/; # note the dereferencing - $$out print $$out; #### $client_descr->{"Handle"} = $handle; $client_descr->{"In"} = \$in; $client_descr->{"Out"} = \$out; $client_descr->{"Err"} = \$err; # later ... my ($handle, $in, $out) = ($client_descr->{"Handle"}, $client_descr->{"In"}, $client_descr->{"Out"}); $in .= "new data\n"; pump $handle until $$out =~ /data arrived:/; # note the dereferencing - $$out print $$out;