On Sat, May 14, 2005 at 04:26:44AM +0000, Luke Palmer wrote:
> On 5/14/05, Larry Wall <[EMAIL PROTECTED]> wrote:
> > I want ::: to break out of *that* dynamic scope (or the equivalent
> > "matchrighthere" scope), but not ::.
>
> I'm not sure that's such a good idea. When you say:
>
> rule foo() { a* ::: b }
>
> You know precisely where that ::: is going to take you: right out of
> the rule. [...] But you're saying that when we use a bare //
> matching a string, that's no longer the case? In other words, this:
>
> $str ~~ / a* ::: b /
>
> Is different from:
>
> $str ~~ / <foo> /
>
> That seems like a pretty obvious indirection, and a mistake to break
> it. There's nothing there except <foo>, how could it act differently?
Because $str ~~ / <foo> / puts the ::: in a subrule, whereas
$str ~~ / a* ::: b / does not. It's the same sort of difference
that one gets between
{ return if $a; }
and
sub foo() { return if $a; }
{ foo() }
It's clear that the C<return> in the first case affects control flow in
in the current sub, while the nested C<return> of foo() in the second
case does not.
Pm