Skip to content

Commit 0810e68

Browse files
committed
Clarify special vars section
1 parent ea84e6c commit 0810e68

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/Language/variables.pod

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,6 @@ dynamic variable using L<the * twigil|#The_*_Twigil>.
401401
402402
=head2 The C<state> Declarator
403403
404-
=head2 The C<state> Declarator
405-
406404
=head2 The C<augment> Declarator
407405
408406
=head2 The C<supersede> Declarator
@@ -413,6 +411,11 @@ dynamic variable using L<the * twigil|#The_*_Twigil>.
413411
414412
=head1 Special Variables
415413
414+
Perl 5 is infamous for its many obscure special variables. Perl 6 also
415+
has special variables, but only has three that are extra short because
416+
of how often they're used. Other special variables have longer, more
417+
descriptive names.
418+
416419
=head2 Often-Used Variables
417420
418421
=comment TODO: find a better heading
@@ -429,7 +432,7 @@ There are three special variables that are available in every block:
429432
430433
=end table
431434
432-
=head3 C<$_>
435+
=head3 The C<$_> Variable
433436
434437
C<$_> is the topic variable. It is the default parameter for blocks that do
435438
not have an explicit signature, so constructs like C<for @array { ... }>
@@ -463,7 +466,7 @@ This outputs:
463466
d$e
464467
ij*
465468
466-
=head3 C<$/>
469+
=head3 The C<$/> Variable
467470
468471
C<$/> is the match variable. It stores the result of each regex match, and
469472
usually contains objects of type L<Match>.
@@ -480,7 +483,7 @@ Other match variables are aliases to elements of C<$/>:
480483
$1 # same as $/[1]
481484
$<named> # same as $/<named>
482485
483-
=head3 C<$!>
486+
=head3 The C<$!> Variable
484487
485488
C<$!> is the error variable. If a C<try> block or statement prefix catches
486489
an exception, that exception is stored in C<$!>. If no exception was caught,

0 commit comments

Comments
 (0)