On Friday, November 22, 2002, at 10:59  AM, Luke Palmer wrote:
From: Michael Lazzaro <[EMAIL PROTECTED]>
(This is a bit off-topic, but it's a tiny bit sad that you can name
subrules, but you can't refer to them by name in the interpolation
unless you use hypothetical vars.  Eh, no biggie: it would introduce
too many problems to allow it.)
IIRC, that's not true.  I believe this is alive and DWIMmy:
    $s ~~ s/ <number> /$number.as(MoneyFormat)/;

I know this is:
    s/ <number> <( $number < 200 )> /
So the second half of the substitution counts as being sufficiently "inside" in order to grab the names from the first half? Huh, I figured that would be a problem, since rules can be so heavily nested. Admittedly I haven't worked through it much, tho.

I've been under the impression that the following would _not_ work:

$s ~~ /<number>/;
print "I found $number";

but this does:

$s ~~ /<number>/;
print "I found $0{number}";

Right?

MikeL

Reply via email to