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:
@@ -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
|
||||||
|
Reference in New Issue
Block a user