summaryrefslogtreecommitdiffhomepage
path: root/perl6.html.markdown
diff options
context:
space:
mode:
authorDivay Prakash <divayprakash@users.noreply.github.com>2019-08-03 00:36:55 +0530
committerGitHub <noreply@github.com>2019-08-03 00:36:55 +0530
commit399d1721550a2323c2604e5db706898a16f854a7 (patch)
tree0b6425ad7df612efba3d21f72a52f76eb0706e0b /perl6.html.markdown
parent787d57ad9f1959da3ee8e3dd832fe42e5602dd3d (diff)
parent06216f24c9d1bf30137f54b12abe59b67acfdc2e (diff)
Merge pull request #3559 from b-xor-a/master
[perl6/en] Fixed output
Diffstat (limited to 'perl6.html.markdown')
-rw-r--r--perl6.html.markdown5
1 files changed, 3 insertions, 2 deletions
diff --git a/perl6.html.markdown b/perl6.html.markdown
index cb64b646..6b0df0d4 100644
--- a/perl6.html.markdown
+++ b/perl6.html.markdown
@@ -247,11 +247,12 @@ concat3(|@array); #=> a, b, c
## arguments. If you really need to, you can ask for a mutable container by
## using the `is rw` trait:
sub mutate( $n is rw ) {
- $n++;
+ $n++; # postfix ++ operator increments its argument but returns its old value
}
my $m = 42;
-mutate $m; #=> 43
+mutate $m; # the value is incremented but the old value is returned
+ #=> 42
say $m; #=> 43
## This works because we are passing the container $m to the `mutate` sub.