Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

Utilizing the Expect Module in a Perl Script

Highlighted
Stephen_175
Occasional Contributor

Utilizing the Expect Module in a Perl Script

I m having issues in correctly integrating the
Expect Module in my Perl Script below. Please advise. Thank you. Stephen

if ($radio_action eq "MOVEGENTS")
{
print "
\n";
system "/var/apache/cgi/bin/compare_gents_files.pl $julian_dt"
$command = Expect->spawn("Check the output above. Continue copying files ? (Y|N)")
unless ($command->expect(1, "y"));
}

I get these errors:
Scalar found where operator expected at ./payment_load_copy_orig_II.pl line 37, near "$command"
(Missing semicolon on previous line?)
syntax error at ./payment_load_copy_orig_II.pl line 37, near "$command "
Execution of ./payment_load_copy_orig_II.pl aborted due to compilation errors.
3 REPLIES
Peter Godron
Honored Contributor

Re: Utilizing the Expect Module in a Perl Script

Stephen,
isn't there a semicolon missing at the end of the $command line?
Should it not be ...(Y|N)");
David Bellamy
Respected Contributor

Re: Utilizing the Expect Module in a Perl Script

Stephen you are missing a semicolon at the end of the previous line.
Peter Godron
Honored Contributor

Re: Utilizing the Expect Module in a Perl Script

Stephen,
is this still a problem?
If it is, please update with new status.
Otherwise please assign points and close.