in reply to Re^4: Lexical scope vs. postfix loops (perl bug?)
in thread Lexical scope vs. postfix loops (perl bug?)
But my opinion doesn't count that much ;-)
Luckily Perl 6 fixes that behaviour by not special casing the scoping at all, and instead introducing blocks with signatures ("pointy blocks", known as lambdas in other programming languages).
# Perl 6 code below: while my $x < 3 { # code here } # $x still visible here for @list -> $y { # $y visible here } # $y not visible here # other uses for lambdas: my $quote = -> Str $s { "'$s'" }
|
|---|