in reply to Re: string increment
in thread string increment

How about some base 26 arithmetic!

perl -e '$s="aaa";for $i (1..28) { ++$s }; print $s;'

gives me 'abc' as its output for 28 increments. So lets consider 'abc' as a 'number':

perl -e 'use Math::BaseCalc;$c = new Math::BaseCalc(digits => [a..z] );print $c->from_base("abc");

The code above gives me back my 28 increments. Ain't perl fun?

To integrate it in your code can be more difficult however because your base string doesn't have to be 'aaaaaaa'. But a little math can do the trick.

--
if ( 1 ) { $postman->ring() for (1..2); }