From: Roland G. <rgi...@cp...> - 2006-12-23 16:44:38
|
I'll second Austins first approach: make the spawned commands exit cleanly. That means, send an "exit\r" or whatever is needed after you get the output from the remote commands. This will cause the remote side to close everything down and you will get an EOF and the spawned command will terminate and the close() will return immediately. BTW, why are you using Expect? You could execute the shell commands via qx'ssh'. Unless you're starting some interactive programs remotely... Regards, Roland PS: Frohe Weihnukka! :o) On 12/23/06, Austin Schutz <te...@of...> wrote: > On Fri, Dec 22, 2006 at 02:49:11PM +0100, Christoph Schwaiger wrote: > > Hello Austin, > > > > thanks for your answer. Currently, I'm already using hard_close, but > > wonder, due to the many objects I close sequentially, even hard_close > > takes too long. > > Would you have an idea how to speed the closure up? > > > you can always just kill(9, $expect->pid()); and then wait(); > > By default nothing does that because sending signals other than > 9 allows the process to clean itself up before exit. But that is the fastest > way to make sure it goes away _now_. In fact you can skip on the wait() if > you don't mind leaving zombies around until your perl process exits. > > Austin > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |