View Single Post
  #1 (permalink)  
Old December 24th, 2006, 07:53 AM
philrobeson philrobeson is offline
Registered User
Join Date: Dec 2006
Location: Atlantic Beach, Florida, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to philrobeson
Default Help with learning perl

I'm doing a program out of a book teaching me perl (I'm new to programming). The program is this:

#!/usr/bin/perl -w
use strict;
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";

It works fine, but I really do not understand why the last line prints as "10" when, following the logic in the book and the previous lines, my thought would be it would print "0a". Can someone please explain this to me?


Reply With Quote