Well, I guess here we talk about 2 different "pos()" functions. The one that is documented under "perldoc -f pos" allows modification of the position where the match has ended. The one you have mentioned, and the one that is used in substitute part of s/// are read-only functions. They can not be used to modify the position. Just the name of the function is the same, but functionality is different.