in reply to Whats with the autoincrementation of a string
Think of every position as a wheel in a mechanical counter.
There are three kinds of wheels 0-9, a-z and A-Z which can be independently be chosen for each position.
Clearer now? =)
edit
perlopthe increment is done as a string, preserving each character within its range, with carry: print ++($foo = '99'); # prints '100' print ++($foo = 'a0'); # prints 'a1' print ++($foo = 'Az'); # prints 'Ba' print ++($foo = 'zz'); # prints 'aaa'
Cheers Rolf
( addicted to the Perl Programming Language)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Whats with the autoincrementation of a string
by space_monk (Chaplain) on Jun 14, 2013 at 20:09 UTC | |
by LanX (Saint) on Jun 14, 2013 at 21:36 UTC |
In Section
Seekers of Perl Wisdom