From 5556d6e839796e06179afec99443bf0a63a23afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20B=C3=A4rring?= Date: Sat, 26 Dec 2015 20:15:51 +0100 Subject: changed code output to as stated in comments The comments state that Foo::Bar::inc in the package variable example should increase $Foo::Bar::n and then print it. This did not happen, as `say ++$n;` was placed outside the block of the sub Foo::Bar::inc. The commit puts `say ++$n;` inside the block of Foo::Bar::inc. --- perl6.html.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'perl6.html.markdown') diff --git a/perl6.html.markdown b/perl6.html.markdown index 1829f964..1457999a 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -803,9 +803,8 @@ module Foo::Bar { my sub unavailable { # `my sub` is the default say "Can't access me from outside, I'm my !"; } + say ++$n; # increment the package variable and output its value } - - say ++$n; # lexically-scoped variables are still available } say $Foo::Bar::n; #=> 1 Foo::Bar::inc; #=> 2 -- cgit v1.2.3