Yes, well sort of, it can do whatever you want.  Incrementing letters like
the example is built in, but for what you are talking about you would need
to build that functionality yourself.  You could use the overload pragma
(see perldoc overload) to override the built in operators and write your own
addition and subtraction routines so that $a + $b added letters instead of
number (or both letters and numbers).

Rob

-----Original Message-----
From: zentara [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 3:51 PM
To: [EMAIL PROTECTED]
Subject: Re: interesting JAPH, how does this work?


On Thu, 10 Jan 2002 12:11:53 -0500, [EMAIL PROTECTED] (Robert Hanson)
wrote:

>You can increment letters just like you increment numbers.
>$x = "a";
>$x++;
>print $x; # prints "b"
>
>And the letter "z" incremented becomes "aa".
>
>$x = "z";
>$x++;
>print $x; # prints "aa"
>
>So here is the script...
>
>$A = "a"; # assign "a" to $A.
>for(0..285074){$A++;} # increment $A 285,074 times
>print"$A\n"; # prints the new value

I get it, so "perl" equals 285075 in a base24 number system,
with the alphabet as it's units.

For the sake of theoretical babbling, could this base24
number system be used to perform math operations in perl?
Carry it to decimal points etc.  Like  perl.sdc ?
 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to