my @scp = ("scp", "long command line...") my $h = start(\@scp, \$in, \$out); $in = "mypassword\n"; pump $h if $out =~ /password/i;