http://www.perlmonks.org?node_id=11120100

zapdos has asked for the wisdom of the Perl Monks concerning the following question:

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.