in reply to Increment/Decrement Operator with Strings

I'm not fond of this kind of magic...
# this works #!/usr/bin/perl -w use strict; my $a = "a"; print ++$a ."\n"; print ++$a ."\n"; print ++$a ."\n"; # this also works #!/usr/bin/perl -w use strict; my $a = "a8"; print ++$a ."\n"; print ++$a ."\n"; print ++$a ."\n"; # but this is unpredictable #!/usr/bin/perl -w use strict; my $a = "a8y"; print ++$a ."\n"; print ++$a ."\n"; print ++$a ."\n";
update Or better as posted by sh1tn: see the difference
perl -e '$char = "a"; print $char++, $/ for 1..20' perl -e '$char = "a0"; print $char++, $/ for 1..20' perl -e '$char = "a0a"; print $char++, $/ for 1..20'
"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.