diff options
author | Chas. Owens <chas.owens@gmail.com> | 2010-08-14 13:05:18 -0500 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2010-08-14 13:05:18 -0500 |
commit | e761bb84a9e140614351efd76e7716ec2238cd75 (patch) | |
tree | 3153d871fa88ce48438eeb34b24c00bd30148fc0 /pod/perlre.pod | |
parent | 22afb09b13a6dc17f20388991422fdbe6166e3ed (diff) | |
download | perl-e761bb84a9e140614351efd76e7716ec2238cd75.tar.gz |
RT #77150: perlre documentation issue and possible fix
Diffstat (limited to 'pod/perlre.pod')
-rw-r--r-- | pod/perlre.pod | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod index 98aafdd184..de5b719772 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -363,11 +363,11 @@ not counted when determining the length of the match. Thus the following will not match forever: X<\G> - $str = 'ABC'; - pos($str) = 1; - while (/.\G/g) { - print $&; - } + my $string = 'ABC'; + pos($string) = 1; + while ($string =~ /(.\G)/g) { + print $1; + } It will print 'A' and then terminate, as it considers the match to be zero-width, and thus will not match at the same position twice in a |