From: Roland G. <r.g...@xs...> - 2001-04-20 09:14:12
|
Wes Morgan wrote: > > I am having some difficulty with Expect.pm. Here is a simple command line that duplicates the behavior I'm seeing, but not on all versions of Perl/Expect.pm. > > perl -e 'use Expect;$exp = Expect->spawn("script", > "test.script"); $exp->interact();print "All done\n";' > > When I run that on my system (Perl 5.6.0, Expect.pm 1.11), it takes about 30 seconds after I exit the script program before I see "All done". When I set Expect->Debug to 1, it says that it times out waiting for an EOF a couple times. That seems to be where the delay is coming from. Can you send me the output with Debug=1? Maybe I can sort some things out. The long delay comes from the DESTROY method of expect being too nice. It first tries to do a soft_close() which waits for 15 seconds for the process to finish, then closes the filehandle, waits another 15 seconds, then sends a SIGTERM and waits *another* 15 seconds. That's much too nice for a doomed process and will be fixed in the next release. Hope this helps, Roland |