From: Blackstone, J. D. <jda...@ci...> - 2002-12-06 22:13:28
|
I just answered my own question by watching the debugging information. Calls to expect with only one parameter will treat that parameter (a string) like the timeout (thank you, Perl; in five years that's the only time I ever regretted the ability to mix and match numbers and strings with impunity) and expect nothing. So I've just been getting REALLY, REALLY, LUCKY. :) jdb > -----Original Message----- > From: Blackstone, J. David > Sent: Friday, December 06, 2002 4:08 PM > To: 'exp...@li...' > Subject: Calling expect without a timeout parameter > > > Looking through some old source code (wow; when did it get > to the point that I had "old" code written with Expect.pm?), > I discovered some routines where I had written things like: > > $x->expect("String"); > $x->send("a\r"); > $x->expect("String2"); > > Apparently I got confused and was thinking of TCL/Expect's > expect command, which does not take the timeout as a parameter. > > Strangely, this code seems to work. Is the expect() method > designed to work like this, or am I just getting lucky by > cramming the right things into the buffer in the right order > and not running into race conditions? > > I'll probably digging through the source code to answer > this unless someone knows off the top of their head. If this > is a feature, not dumb luck, it could go into the docs > somewhere. (And if it's in the docs, I'll accept a cluestick > to my skull.) > > Thanks. > > jdb > |