"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Auto increment and Auto decrement
With the example print ++($foo = "Az"); # prints "Ba" The logic in my head is that it printed uppercase "B" because it's the letter that comes after the uppercase "A", and it printed lowercase "a" because it's what comes after lowercase "z" going back to the first letter of the alphabet that's "a" since "z" is the lastest. So why print ++($foo = "zz"); prints "aaa"? It makes no sense to me. Shouldn't it print just "aa" since there's two z characters? 2020-08-04 Athanasius shortened link. In reply to How the auto-increment operator works? by zapdos
|
|