Skip to content

Commit 8400efe

Browse files
committed
perlfunc: Remove self-referential links
It is not good form to have links in the middle of a section go back to the top of that very section. Someone clicks on it, thinking they are going to get more detail or a different explanation, and all that happens is they lose their place in the section.
1 parent 1951e39 commit 8400efe

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

pod/perlfunc.pod

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,7 +2144,7 @@ Hash entries are returned in an apparently random order. The actual random
21442144
order is specific to a given hash; the exact same series of operations
21452145
on two hashes may result in a different order for each hash. Any insertion
21462146
into the hash may change the order, as will any deletion, with the exception
2147-
that the most recent key returned by L<C<each>|/each HASH> or
2147+
that the most recent key returned by C<each> or
21482148
L<C<keys>|/keys HASH> may be deleted without changing the order. So
21492149
long as a given hash is unmodified you may rely on
21502150
L<C<keys>|/keys HASH>, L<C<values>|/values HASH> and
@@ -2154,20 +2154,20 @@ details on why hash order is randomized. Aside from the guarantees
21542154
provided here, the exact details of Perl's hash algorithm and the hash
21552155
traversal order are subject to change in any release of Perl.
21562156

2157-
After L<C<each>|/each HASH> has returned all entries from the hash or
2158-
array, the next call to L<C<each>|/each HASH> returns the empty list in
2157+
After C<each> has returned all entries from the hash or
2158+
array, the next call to C<each> returns the empty list in
21592159
list context and L<C<undef>|/undef EXPR> in scalar context; the next
21602160
call following I<that> one restarts iteration. Each hash or array has
2161-
its own internal iterator, accessed by L<C<each>|/each HASH>,
2161+
its own internal iterator, accessed by C<each>,
21622162
L<C<keys>|/keys HASH>, and L<C<values>|/values HASH>. The iterator is
2163-
implicitly reset when L<C<each>|/each HASH> has reached the end as just
2163+
implicitly reset when C<each> has reached the end as just
21642164
described; it can be explicitly reset by calling L<C<keys>|/keys HASH>
21652165
or L<C<values>|/values HASH> on the hash or array, or by referencing
21662166
the hash (but not array) in list context. If you add or delete
21672167
a hash's elements while iterating over it, the effect on the iterator is
21682168
unspecified; for example, entries may be skipped or duplicated--so don't
21692169
do that. Exception: It is always safe to delete the item most recently
2170-
returned by L<C<each>|/each HASH>, so the following code works properly:
2170+
returned by C<each>, so the following code works properly:
21712171

21722172
while (my ($key, $value) = each %hash) {
21732173
print $key, "\n";
@@ -2227,10 +2227,10 @@ but in a different order:
22272227
}
22282228

22292229
Starting with Perl 5.14, an experimental feature allowed
2230-
L<C<each>|/each HASH> to take a scalar expression. This experiment has
2230+
C<each> to take a scalar expression. This experiment has
22312231
been deemed unsuccessful, and was removed as of Perl 5.24.
22322232

2233-
As of Perl 5.18 you can use a bare L<C<each>|/each HASH> in a C<while>
2233+
As of Perl 5.18 you can use a bare C<each> in a C<while>
22342234
loop, which will set L<C<$_>|perlvar/$_> on every iteration.
22352235
If either an C<each> expression or an explicit assignment of an C<each>
22362236
expression to a scalar is used as a C<while>/C<for> condition, then
@@ -3943,9 +3943,9 @@ order is specific to a given hash; the exact same series of operations
39433943
on two hashes may result in a different order for each hash. Any insertion
39443944
into the hash may change the order, as will any deletion, with the exception
39453945
that the most recent key returned by L<C<each>|/each HASH> or
3946-
L<C<keys>|/keys HASH> may be deleted without changing the order. So
3946+
C<keys> may be deleted without changing the order. So
39473947
long as a given hash is unmodified you may rely on
3948-
L<C<keys>|/keys HASH>, L<C<values>|/values HASH> and L<C<each>|/each
3948+
C<keys>, L<C<values>|/values HASH> and L<C<each>|/each
39493949
HASH> to repeatedly return the same order
39503950
as each other. See L<perlsec/"Algorithmic Complexity Attacks"> for
39513951
details on why hash order is randomized. Aside from the guarantees
@@ -3954,10 +3954,10 @@ traversal order are subject to change in any release of Perl. Tied hashes
39543954
may behave differently to Perl's hashes with respect to changes in order on
39553955
insertion and deletion of items.
39563956

3957-
As a side effect, calling L<C<keys>|/keys HASH> resets the internal
3957+
As a side effect, calling C<keys> resets the internal
39583958
iterator of the HASH or ARRAY (see L<C<each>|/each HASH>) before
39593959
yielding the keys. In
3960-
particular, calling L<C<keys>|/keys HASH> in void context resets the
3960+
particular, calling C<keys> in void context resets the
39613961
iterator with no other overhead.
39623962

39633963
Here is yet another way to print your environment:
@@ -3986,7 +3986,7 @@ sort of a hash by its values:
39863986
printf "%4d %s\n", $hash{$key}, $key;
39873987
}
39883988

3989-
Used as an lvalue, L<C<keys>|/keys HASH> allows you to increase the
3989+
Used as an lvalue C<keys> allows you to increase the
39903990
number of hash buckets
39913991
allocated for the given hash. This can gain you a measure of efficiency if
39923992
you know the hash is going to get big. (This is similar to pre-extending
@@ -3999,12 +3999,12 @@ in fact, since it rounds up to the next power of two. These
39993999
buckets will be retained even if you do C<%hash = ()>, use C<undef
40004000
%hash> if you want to free the storage while C<%hash> is still in scope.
40014001
You can't shrink the number of buckets allocated for the hash using
4002-
L<C<keys>|/keys HASH> in this way (but you needn't worry about doing
4002+
C<keys> in this way (but you needn't worry about doing
40034003
this by accident, as trying has no effect). C<keys @array> in an lvalue
40044004
context is a syntax error.
40054005

40064006
Starting with Perl 5.14, an experimental feature allowed
4007-
L<C<keys>|/keys HASH> to take a scalar expression. This experiment has
4007+
C<keys> to take a scalar expression. This experiment has
40084008
been deemed unsuccessful, and was removed as of Perl 5.24.
40094009

40104010
To avoid confusing would-be users of your code who are running earlier
@@ -10509,7 +10509,7 @@ into the hash may change the order, as will any deletion, with the exception
1050910509
that the most recent key returned by L<C<each>|/each HASH> or
1051010510
L<C<keys>|/keys HASH> may be deleted without changing the order. So
1051110511
long as a given hash is unmodified you may rely on
10512-
L<C<keys>|/keys HASH>, L<C<values>|/values HASH> and
10512+
L<C<keys>|/keys HASH>, C<values> and
1051310513
L<C<each>|/each HASH> to repeatedly return the same order
1051410514
as each other. See L<perlsec/"Algorithmic Complexity Attacks"> for
1051510515
details on why hash order is randomized. Aside from the guarantees
@@ -10518,10 +10518,10 @@ traversal order are subject to change in any release of Perl. Tied hashes
1051810518
may behave differently to Perl's hashes with respect to changes in order on
1051910519
insertion and deletion of items.
1052010520

10521-
As a side effect, calling L<C<values>|/values HASH> resets the HASH or
10521+
As a side effect, calling C<values> resets the HASH or
1052210522
ARRAY's internal iterator (see L<C<each>|/each HASH>) before yielding the
1052310523
values. In particular,
10524-
calling L<C<values>|/values HASH> in void context resets the iterator
10524+
calling C<values> in void context resets the iterator
1052510525
with no other overhead.
1052610526

1052710527
Apart from resetting the iterator,
@@ -10537,7 +10537,7 @@ modify the contents of the hash:
1053710537
for (@hash{keys %hash}) { s/foo/bar/g } # same
1053810538

1053910539
Starting with Perl 5.14, an experimental feature allowed
10540-
L<C<values>|/values HASH> to take a
10540+
C<values> to take a
1054110541
scalar expression. This experiment has been deemed unsuccessful, and was
1054210542
removed as of Perl 5.24.
1054310543

0 commit comments

Comments
 (0)