in reply to Range operator anomaly

The shortest way I've found to reproduce that is:

perl -wE "say for '1' .. q['']"

Which counts to 99. It counts up until the the length of the string exceed the length of the RHS. Other characters on the RHS work too, for example for '1' .. 'aa'.

So it seems that the range iteration with strings doesn't use ordinary cmp semantics (nor one of lt/le/gt/ge), but rather something that uses string length as the primary criterion.

And I guess that kind of makes sense, otherwise "1" .. "a" would run infinitely, because the magical postincrement would produce 9 and then 10, which is still stringy less-than 'a', and then all the numbers off to infinity.