CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



newtoperl123
New User

Aug 2, 2013, 3:12 AM

Post #1 of 1 (356 views)
Unable to send using Perl Expect Can't Post

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 ..



Code
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";
if($update->expect(6,'Update?')){
print "spawn continue";
#$test=$update->expect(6,'Update?');
$test2=$update->send("y\r");
my $exp = Expect->send("y\r");}
else { print "not spawn";}
print "Test is $exp";


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives