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;