Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add example of an anonymous sub return itself
  • Loading branch information
lizmat committed Jun 12, 2018
1 parent 3347f71 commit 80a4f64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/Language/5to6-perlop.pod6
Expand Up @@ -70,10 +70,10 @@ C<+> I<does> have an effect in Perl 6, coercing its argument to the
Numeric type.
Unary C<\> is no more. If you really want to take a reference to an existing
named variable, you can use item context, like so: C<$aref = item(@array)>
You can get a reference to a named subroutine by using the C<&> sigil: C<$sref
= &foo> Anonymous arrays, hashes, and subs return their references during
creation I<right away>.
named variable, you can use item context, like so: C<$aref = item(@array)>, or
maybe more familiarly: C<$aref = $@array>. You can get a reference to a named
subroutine by using the C<&> sigil: C<$sref = &foo>. Anonymous arrays, hashes,i
and subs return their references during creation I<right away>: C<$sref = sub { }>.
=head2 Binding Operators
Expand Down

0 comments on commit 80a4f64

Please sign in to comment.