Syntactic Confectionery Delight | |
PerlMonks |
Re: Re: string incrementby gargle (Chaplain) |
on Sep 13, 2005 at 11:48 UTC ( [id://491555]=note: print w/replies, xml ) | Need Help?? |
How about some base 26 arithmetic!
gives me 'abc' as its output for 28 increments. So lets consider 'abc' as a 'number':
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); }
In Section
Seekers of Perl Wisdom
|
|