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 From e31dc8b5a7937d25a681747d05b6227d63849c6d Mon Sep 17 00:00:00 2001 From: Owen Rodda Date: Sun, 27 Dec 2015 16:29:52 -0500 Subject: Fix #2040 --- perl6.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl6.html.markdown') diff --git a/perl6.html.markdown b/perl6.html.markdown index 1829f964..323bc0b3 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; } -- cgit v1.2.3 From cc31c2f0c5032b723a1d57c971580121be07bf7f Mon Sep 17 00:00:00 2001 From: Jacob Ward Date: Thu, 7 Jan 2016 22:08:17 -0700 Subject: Fix typo referenced in Issue #2075 --- perl6.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl6.html.markdown') diff --git a/perl6.html.markdown b/perl6.html.markdown index 6633b322..5082a433 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -1329,7 +1329,7 @@ so 'ayc' ~~ / a [ b | y ] c /; # `True`. Obviously enough ... -### Extra: the MAIN subroutime +### Extra: the MAIN subroutine # The `MAIN` subroutine is called when you run a Perl 6 file directly. # It's very powerful, because Perl 6 actually parses the arguments # and pass them as such to the sub. It also handles named argument (`--foo`) -- cgit v1.2.3