This appeared to me to be odd behavior too. I guess the answer is context. According to the Camel, Chapter 5 : Pattern Matching, /g in list context returns a list of all matches. Only /g in scalar context indicates a progressive match.
So attempting to assign values in the while expression:
while( ($b, $c) = $a =~ /(.)(.)/g ){
caused list context, thus no progressive match and no pos.
YuckFoo
In reply to Re: puzzled by pos
by YuckFoo
in thread puzzled by pos
by belg4mit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |