@@ -43,8 +43,8 @@ the inner working of Perl have names containing punctuation characters.
43
43
These are documented in L<perlvar>.
44
44
X<variable, built-in>
45
45
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
48
48
semantically like the English word "the" in that it indicates a
49
49
single value is expected.
50
50
X<scalar>
@@ -55,7 +55,7 @@ X<scalar>
55
55
$#days # the last index of array @days
56
56
57
57
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,
59
59
in that it indicates multiple values are expected.
60
60
X<array>
61
61
@@ -68,9 +68,9 @@ X<hash>
68
68
69
69
%days # (key1, val1, key2, val2 ...)
70
70
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
72
72
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< '*'> ,
74
74
but you don't really care about that yet (if ever :-).
75
75
76
76
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,
83
83
but that's okay, because it is weird.
84
84
X<namespace>
85
85
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
88
88
variable
89
89
names. They I<are> reserved with respect to labels and filehandles,
90
90
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.
1158
1158
$t = @a[0, 1]; # $t is now 'second'
1159
1159
$u = @h{'first', 'second'}; # $u is now 'B'
1160
1160
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
1163
1163
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
1165
1165
hash indicates whether you are getting back a singular value (a
1166
1166
scalar) or a plural one (a list).
1167
1167
0 commit comments