summaryrefslogtreecommitdiffhomepage
path: root/perl6.html.markdown
diff options
context:
space:
mode:
authorsarthfrey <sarth.frey@gmail.com>2016-01-25 18:26:23 -0500
committersarthfrey <sarth.frey@gmail.com>2016-01-25 18:26:23 -0500
commit279c28ce7dcc3f155f71c7a073e939630e8f05b6 (patch)
treecd06525da5a4350916143f025b2e5a64a56922aa /perl6.html.markdown
parent299d064ecf7598144e49ef336e0abd00ccc4ae16 (diff)
parent928edf12092cea82a9eded6848b8d0b0710a977c (diff)
Merge remote-tracking branch 'adambard/master'
# Conflicts: # python.html.markdown
Diffstat (limited to 'perl6.html.markdown')
-rw-r--r--perl6.html.markdown7
1 files changed, 3 insertions, 4 deletions
diff --git a/perl6.html.markdown b/perl6.html.markdown
index 1829f964..5082a433 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
@@ -1330,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`)