Utilizing the Expect Module in a Perl Script (46 Views)
Reply
Occasional Contributor
Stephen_175
Posts: 8
Registered: ‎09-16-2005
Message 1 of 4 (46 Views)

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.
Please use plain text.
Honored Contributor
Peter Godron
Posts: 4,470
Registered: ‎02-13-2002
Message 2 of 4 (46 Views)

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)");
Please use plain text.
Respected Contributor
David Bellamy
Posts: 211
Registered: ‎06-29-1999
Message 3 of 4 (46 Views)

Re: Utilizing the Expect Module in a Perl Script

Stephen you are missing a semicolon at the end of the previous line.
Please use plain text.
Honored Contributor
Peter Godron
Posts: 4,470
Registered: ‎02-13-2002
Message 4 of 4 (46 Views)

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.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation