Em Dom, 2009-07-12 às 22:51 +0200, Moritz Lenz escreveu:
I setting of OUTER::$/ considered syntactic sugar?
I don't care either way, I'd just like some clarification so that I can
write tests and submit tickets (if appropriate).
As far as I remember, it's not really OUTER::$/, but each routine
implicitly declare
my $/ is contextrw;
my $! is contextrw;
so what happens inside m// or s/// is that inside that it should look
for $*/, as well as the process of failing should look for $*!. This
also has the advantage of:
{
'abc' ~~ /abc/;
say $/; # prints abc
{
my $/ is contextrw;
'bcd' ~~ /bcd';
say $/; # prints bcd;
}
say $/; # still prints abc;
}
I'm pretty sure that was just said by TimToady on IRC a lot of time ago
and no spec actually defines it.
That being said, I don't think there's a reason for .match and .subst
not to look and set $*/.
daniel