summaryrefslogtreecommitdiff
path: root/pod/perlop.pod
diff options
context:
space:
mode:
authorHauke D <haukex@zero-g.net>2020-02-10 20:24:35 +0100
committerNicolas R <nicolas@atoomic.org>2020-07-30 17:14:27 -0600
commitf4941eebb5185b70b980fcfea9f7b02f377f1f70 (patch)
treeb86f397a369ed622a183391359e0753c06a8d2ef /pod/perlop.pod
parent015b02fd303c1bc1372d284a230e8e84520de109 (diff)
downloadperl-f4941eebb5185b70b980fcfea9f7b02f377f1f70.tar.gz
Note range op behavior change in docs
This change documents the previous behavior of the range operator with magic string increment in Perl 5.30 and below - the change was introduced in commit d1bc97feec from GitHub #16770 (RT133695).
Diffstat (limited to 'pod/perlop.pod')
-rw-r--r--pod/perlop.pod8
1 files changed, 8 insertions, 0 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod
index 2f0fa4abf7..3e6c10f767 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -1214,6 +1214,14 @@ If you want to force strings to be interpreted as numbers, you could say
@numbers = ( 0+$first .. 0+$last );
+B<Note:> In Perl versions 5.30 and below, I<any> string on the left-hand
+side beginning with C<"0">, including the string C<"0"> itself, would
+cause the magic string increment behavior. This means that on these Perl
+versions, C<"0".."-1"> would produce C<"0"> through C<"99">, which was
+inconsistent with C<0..-1>, which produces the empty list. This also means
+that C<"0".."9"> now produces a list of integers instead of a list of
+strings.
+
=item *
If the initial value specified isn't part of a magical increment