Yeah, they're lexical, just like in Perl 5.
Luke
say $1; # undef?
> > "abc" ~~ /^(.)/; # $1 now "a"
> > }
> >
> > sub bar() {
> > "def" ~~ /^(.)/; # $1 now "d"
> > foo();
> > say $1; # Outputs "d"
> > }
> >
> > bar();
> >
> > # Correct (I hope so)?
>
> Yeah, they're lexical, just like in Perl 5.
Not just like Perl 5, I hope. If it was then the above would print
"d".
--
Rick Delaney
ri...@bort.ca
Yes, Perl 5 actually uses an autolocalizing form of dynamic scoping
for the current successful match, but *only* if there was a successful
match. We're intentionally breaking that.
Larry