Author: larry Date: Sat Mar 10 09:55:37 2007 New Revision: 14328 Modified: doc/trunk/design/syn/S02.pod
Log: further clarifications of substitution and reported string positions Modified: doc/trunk/design/syn/S02.pod ============================================================================== --- doc/trunk/design/syn/S02.pod (original) +++ doc/trunk/design/syn/S02.pod Sat Mar 10 09:55:37 2007 @@ -595,7 +595,12 @@ string that will give the same results if applied to the same string in any context. This is assuming the string isn't modified in the meanwhile; a C<StrPos> is not a "marker" and is not required to follow -changes to a mutable string. +changes to a mutable string. For instance, if you ask for the positions +of matches done by a substitution, the answers are reported in terms of the +original string (which may now be inaccessible!), not as positions within +the modified string. (However, if you use C<.pos> on the modified string, +it will report the position of the end of the substitution in terms +of the new string.) The subtraction of two C<StrPos> objects gives a C<StrLen> object, which is also not an integer, because the string between two positions