diff options
Diffstat (limited to 'perl6.html.markdown')
| -rw-r--r-- | perl6.html.markdown | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/perl6.html.markdown b/perl6.html.markdown index 1829f964..6633b322 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -103,7 +103,7 @@ sub say-hello-to(Str $name) { # You can provide the type of an argument  ## It can also have optional arguments:  sub with-optional($arg?) { # the "?" marks the argument optional -  say "I might return `(Any)` (Perl's "null"-like value) if I don't have +  say "I might return `(Any)` (Perl's 'null'-like value) if I don't have          an argument passed, or I'll return my argument";    $arg;  } @@ -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 | 
