bingalee has asked for the wisdom of the Perl Monks concerning the following question:
Im trying to figure this out but I dont get it. Here's the code
#!/usr/bin/perl use warnings; $a = "A9"; print ++$a, "\n"; $a = "bz"; print ++$a, "\n"; $a = "Zz"; print ++$a, "\n"; $a = "z9"; print ++$a, "\n"; $a = "9z"; print ++$a, "\n";
OUTPUT
>perl auto2.plx B0 ca AAa aa0 10 >
I get the first two outputs, A turns to B and 9 to 0.
But how does "Zz" become "AAa", "z9" become "aa0" and so on.. *confused*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Whats with the autoincrementation of a string
by space_monk (Chaplain) on Jun 14, 2013 at 18:54 UTC | |
by bingalee (Acolyte) on Jun 18, 2013 at 20:03 UTC | |
by choroba (Cardinal) on Jun 18, 2013 at 20:06 UTC | |
by bingalee (Acolyte) on Jun 18, 2013 at 21:19 UTC | |
by space_monk (Chaplain) on Jun 19, 2013 at 05:52 UTC | |
| |
|
Re: Whats with the autoincrementation of a string
by LanX (Saint) on Jun 14, 2013 at 18:56 UTC | |
by space_monk (Chaplain) on Jun 14, 2013 at 20:09 UTC | |
by LanX (Saint) on Jun 14, 2013 at 21:36 UTC |