From: Blackstone, J. D. <jda...@ci...> - 2002-08-05 13:59:08
|
> -----Original Message----- > From: Roland Giersig [mailto:RGi...@cp...] > Sent: Sunday, August 04, 2002 5:00 AM > To: Blackstone, J. David > Cc: exp...@li... > Subject: RE: [Expectperl-discuss] quotes around $scalar > > > Quoting "Blackstone, J. David" <jda...@ci...>: > > > Another thing I meant to say about regexes is I think it would be > > really cool if we could drop -re altogether. To my mind it > seems like the > > method should use ref to see if you've passed a qr// regex > or a plain > > scalar. Of course, my mind doesn't work like anyone else's, and it > would break > > backward compatibility. > > Right, and that's why it's not gonna happen. Please note > that with the > new syntax with callbacks it's already the default: > > $exp->expect($timeout, > [ "regexp", \&callback ], > [ qr/regexp/, \&callback ],); > > And this is the much more powerful syntax, so I personally > consider the > old syntax (where you have to test which regexp index has matched) > somewhat obsolete and only a beginners drug to get them hooked until > they realize the full power of callbacks... :-) Ah, that makes sense. I only use the older syntax for very simple statements, e.g.: $x->expect($t, "string"); that is, when I want to do the equivalent to TCL/Expect's expect string Of course, with ref $regex, there's no telling what you can do. :) jdb |