in reply to puzzled by pos
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
|
|---|