develooper Front page | perl.perl6.language | Postings from May 2005

Re: Scoping of $/

Thread Previous | Thread Next
From:
Luke Palmer
Date:
May 10, 2005 05:20
Subject:
Re: Scoping of $/
Message ID:
7ca3f01605051005203c5505f5@mail.gmail.com
On 5/10/05, Ingo Blechschmidt <iblech@web.de> wrote:
> Hi,
> 
>   sub foo() {
>     "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.

Luke

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About