From: KhAoZ <xk...@gm...> - 2009-04-21 14:01:16
|
I've been developing with Expect on this one system, and I have a huge code base that works perfectly fine on that server. However, I just tried moving to another server (of the exact spec and OS), and I'm getting a different behavior with the pattern matching with respect to the command accumulation. On the server that works, when I run a command, the pattern matching behavior is as follows: output line #1 -> try all patterns output line #1 output line #2 -> try all patterns output line #1 outline line #2 output line #3 -> try all patterns -> found a match output line #4 ... etc... However, on this other server, the following happens: output line #1 output line #2 output line #3 output line #4 output line #5 -> try all patterns All the output from the command is accumulated immediately, and then matched against the pattern, rather than matching every time a new line is echoed from the command. When I was developing on my original server, I built around the first scenario, and now a lot of my code is breaking because I seriously though thats how Expect worked: add one line to the accumulator each time, and try the patterns. I really don't want to rewrite and retest all the code so that it can work in both scenarios, is there anyway to force the behavior of scenario one? Does anyone have an idea why the behavior is different, is it maybe a system setting that can be changed (Perl 5.8.3 on Solaris 10 for both servers, except the first one is using an ActivePerl distribution). I tried seeing if turning Multi-line off would help remedy the situation, but that breaks a lot of code that makes use of $ and ^ in the patterns. I can provide debug logs or clarify exactly how this is breaking my code if anyone wishes. Any help is appreciated. |