Home: Perl Programming Help: Beginner:
Unable to send using Perl Expect

New User

Aug 2, 2013, 3:12 AM

Views: 984
Unable to send using Perl Expect

Hi ,

I have the following perl expect script, the send function does not work, basically I need to enter 'y' for an interactive script , but the following script does not send 'y'

can some one please check why send does not work.

Thanks ..

use Expect; 
my $ex = Expect->new;
my $login ="/my/app/test autoupdate";
my $update = Expect->spawn($login) or die "Can't run autoupdate : $!\n";

print "Autoupdate $login\n";
print "spawn continue";
my $exp = Expect->send("y\r");}
else { print "not spawn";}
print "Test is $exp";