Skip to content

Commit e8bbad6

Browse files
committed
perldata: Add some C<...>
1 parent f93ae73 commit e8bbad6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pod/perldata.pod

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ the inner working of Perl have names containing punctuation characters.
4343
These are documented in L<perlvar>.
4444
X<variable, built-in>
4545

46-
Scalar values are always named with the sigil '$', even when referring to a
47-
scalar that is part of an array or a hash. The '$' symbol works
46+
Scalar values are always named with the sigil C<'$'>, even when referring to a
47+
scalar that is part of an array or a hash. The C<'$'> symbol works
4848
semantically like the English word "the" in that it indicates a
4949
single value is expected.
5050
X<scalar>
@@ -55,7 +55,7 @@ X<scalar>
5555
$#days # the last index of array @days
5656

5757
Entire arrays (and slices of arrays and hashes) are denoted by the sigil
58-
'@', which works much as the word "these" or "those" does in English,
58+
C<'@'>, which works much as the word "these" or "those" does in English,
5959
in that it indicates multiple values are expected.
6060
X<array>
6161

@@ -68,9 +68,9 @@ X<hash>
6868

6969
%days # (key1, val1, key2, val2 ...)
7070

71-
In addition, subroutines are named with an initial sigil '&', though this
71+
In addition, subroutines are named with an initial sigil C<'&'>, though this
7272
is optional when unambiguous, just as the word "do" is often redundant
73-
in English. Symbol table entries can be named with an initial '*',
73+
in English. Symbol table entries can be named with an initial C<'*'>,
7474
but you don't really care about that yet (if ever :-).
7575

7676
Every variable type has its own namespace, as do several
@@ -83,8 +83,8 @@ is a part of @foo, not a part of $foo. This may seem a bit weird,
8383
but that's okay, because it is weird.
8484
X<namespace>
8585

86-
Because variable references always start with the sigils '$', '@', or
87-
'%', the "reserved" words aren't in fact reserved with respect to
86+
Because variable references always start with the sigils C<'$'>, C<'@'>, or
87+
C<'%'>, the "reserved" words aren't in fact reserved with respect to
8888
variable
8989
names. They I<are> reserved with respect to labels and filehandles,
9090
however, which don't have an initial special character. You can't
@@ -1158,10 +1158,10 @@ Slices in scalar context return the last item of the slice.
11581158
$t = @a[0, 1]; # $t is now 'second'
11591159
$u = @h{'first', 'second'}; # $u is now 'B'
11601160

1161-
If you're confused about why you use an '@' there on a hash slice
1162-
instead of a '%', think of it like this. The type of bracket (square
1161+
If you're confused about why you use an C<'@'> there on a hash slice
1162+
instead of a C<'%'>, think of it like this. The type of bracket (square
11631163
or curly) governs whether it's an array or a hash being looked at.
1164-
On the other hand, the leading symbol ('$' or '@') on the array or
1164+
On the other hand, the leading symbol (C<'$'> or C<'@'>) on the array or
11651165
hash indicates whether you are getting back a singular value (a
11661166
scalar) or a plural one (a list).
11671167

0 commit comments

Comments
 (0)