http://qs321.pair.com?node_id=147180

perlknight has asked for the wisdom of the Perl Monks concerning the following question: (input and output)

I need to know if it's possible to print encode blanks or some other types of character while sending password to expect FH. If so, how? Thanks for your input.

sub copyover { my $scp=Expect->spawn("/usr/bin/scp -r \"$srcpath\" ${dest_hos +t}:$destpath"); my $spawn_ok; $scp->expect(30, [ qr'ssword: ', sub { $spawn_ok=1; print $scp ("password\n"); exp_continue; } ], [ qr'yes/no', sub { $spawn_ok=1; $scp->send("yes\n"); exp_continue; } ], '-re', qr'[#>:] $', #' ); $scp->soft_close(); return; }

Originally posted as a Categorized Question.