From: <pat...@cc...> - 2002-03-01 21:17:03
|
> From: Bennett, Patrick > Subject: RE: [Expectperl-discuss] Need to get the very last > thing output by the program > > Those problems seem to have been alleviated, but a > new one is happening now: > > Can't locate object method "autoflush" via package > "Expect=GLOB(0x828bf70)" (perhaps you forgot to load > "Expect=GLOB(0x828bf70)"?) at > /usr/local/lib/perl5/site_perl/5.6.1/Expect.pm line 89. This error occured because of the way I was creating the $exp object. I wanted to create it before spawning the command so that I could do a $exp->log_user(0) before the process started spitting out stuff. What I discovered is that you can go it after just fine, as below: $exp = Expect->spawn ( $command, @params ); $exp->log_user(0); $exp->expect (..... So now things are working. Thought this might help others trying to do something similar. Patrick |