From: Prem S. <pre...@ya...> - 2007-12-31 09:13:10
|
Hi, I am trying to spawn commands using the same exp object and getting the following error. My testing involves execution of a unix based command and then based on the O/p, I need to send in values. Right now, I need to create 45 objects for executing 45 such commands. Let me know is it a limitation or I am misssing smethg here ? Cannot reuse an object with an already spawned command at expectproblem.pl line 32 Code : $exp->spawn($cmd); $exp->expect(10000, [ qr'^Dialing', sub { $spawn_ok = 1; my $fh = shift; $fh->send("\c\\n"); exp_continue; } ], ); $exp->spawn($cmd); <<<< This throws out the error due to the same obj usage ... $exp->expect(10000, [ qr'^Dialing', sub { $spawn_ok = 1; my $fh = shift; $fh->send("\c\\n"); exp_continue; } ], ); -- View this message in context: http://www.nabble.com/Do-I-need-to-specify-unquie-expect-obj-for-each-spawn-command---tp14555577p14555577.html Sent from the Perl - Expectperl-Discuss mailing list archive at Nabble.com. |