Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: string increment

by gargle (Chaplain)
on Sep 13, 2005 at 07:46 UTC ( [id://491507]=note: print w/replies, xml ) Need Help??


in reply to string increment

Hi,

It's base 26 aritmetic :)

Base 10 aritmetic

The following adds 1 ten times to the number 0. The output is 10.

perl -e '$s=0;for $i (1..10) { ++$s }; print $s;'
Base 26 aritmetic

The following adds '1' 26 times to the 'number' 'a'. The output is 'aa'.

perl -e '$s="a";for $i (1..26) { ++$s }; print $s;'
--
if ( 1 ) { $postman->ring() for (1..2); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://491507]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found