1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-10 16:54:33 +02:00

Merge pull request #2076 from tlvb/p6-packages-foobar

[perl 6] changed code output to as stated in comments
This commit is contained in:
Adam Bard
2016-01-06 03:11:23 +08:00

View File

@@ -803,9 +803,8 @@ module Foo::Bar {
my sub unavailable { # `my sub` is the default my sub unavailable { # `my sub` is the default
say "Can't access me from outside, I'm my !"; 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 say $Foo::Bar::n; #=> 1
Foo::Bar::inc; #=> 2 Foo::Bar::inc; #=> 2