|
From: Blackstone, J. D. <jda...@ci...> - 2002-07-05 19:52:07
|
Playing devil's advocate to myself, $1, $2, etc. are only readable because
I'm familiar with them. $exp->matchlist could be argued to be much more
readable.
jdb
> -----Original Message-----
> From: Blackstone, J. David [mailto:jda...@ci...]
> Sent: Friday, July 05, 2002 2:19 PM
> To: exp...@li...
> Subject: [Expectperl-discuss] Getting at what you matched
>
>
> This:
>
> $x->expect($t,
> [qr/literal(\d+)literal/ =>
> sub {print "The number is $1\n"}]);
>
> doesn't do what I would expect. $1, $2, etc. don't seem to
> be set by the
> regex matching in _multi_expect.
>
> Compare this to TCL Expect:
>
> expect -re "literal(\[0-9]+)literal" {
> send "The number is $expect_out(1,string)\n"
> }
>
>
> Of course, getting _multi_expect to preserve $1, $2, etc.
> would probably
> be a nightmare. It would be Real Swell, though.
>
> jdb
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Bringing you mounds of caffeinated joy.
> http://thinkgeek.com/sf
> _______________________________________________
> Expectperl-discuss mailing list
> Exp...@li...
> https://lists.sourceforge.net/lists/listinfo/expectperl-discuss
>
|