forked from schacon/perl
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subject: Re: resetting pos broken in _20 On Mon, 13 Jan 1997 12:49:24 EST, Ilya Zakharevich wrote: >Gurusamy Sarathy writes: >> What's wrong with saying >> C<pos $foo = length $foo> after /g fails, to get the behavior >> you want? > >Since this has different semantics. You need to get `pos' before each >match, and reset it after each failing match. > > /=/g; /;/g; /=/g; /;/g; > >may give you non-monotoneous movement of `pos' over the string, which >is a bad thing. Ahh, of course. >But I still do not understand what you mean by "having pos at >end". The bug was that position is reset at failing match, probably >you have some other case in mind? Never mind, I was missing the possibility of chaining //g matches with the \G escape :-( >I did not realize that pos was available at perl 4.?, bug-for-bug >compatibility may be a reason if this was so for so many years... The bug fix seems to make a lot sense (to me) now. \G was essentially useless without the new "incompatiblity", eh? Here's a pod update that documents current behavior in all the places I could think of. - Sarathy. gsar@engin.umich.edu p5p-msgid: <199701132013.PAA26606@aatma.engin.umich.edu>
- Loading branch information
Gurusamy Sarathy
authored and
Chip Salzenberg
committed
Jan 15, 1997
1 parent
7c36043
commit b2a07c1
Showing
5 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters