From: Blackstone, J. D. <jda...@ci...> - 2002-07-31 20:26:04
|
I don't think you're supposed to use pids with -i; I think you're supposed to use the Expect object itself. Otherwise, how would it get the object to expect on? jdb -----Original Message----- From: Heidi Ng [mailto:ng_...@ya...] Sent: Wednesday, July 31, 2002 3:11 PM To: exp...@li... Subject: [Expectperl-discuss] using multiple expect objects Hi, I am trying to write a script program which spawns and uses multiple Expect session. I tried using the '-i' option with the Expect object's PID but it gave me the following error message. I got the pid by using $pid = $session->pid() and this returned an integer '1088; to me. Can someone please help me? Thanx! Heidi Can't use string ("1088") as a symbol ref while "strict refs" in use at /usr/lib /perl5/5.6.1/Expect.pm line 564. sub expMatch { my ($session, $pid, $send_arg, $expect_arg) = @_; print $session "$send_arg\r" $temp = $session->expect( $timeout, '-i', [$pid], ['-re', $expect_arg], ['timeout', sub {print "TIMEOUT expecting $expect_arg\n"}] ); } Do You Yahoo!? Yahoo! Health - Feel better, live better |