in reply to increment # but keep # of digits same

You probably want sprintf, sprintf("%04d",$number) will return it in a 4 digit number padded by zeros, then you can do a test to see if the number is greater than 9999 and handle it according. also, ++ will maintain the zeros if they are in the variable... i.e.
$a = '0001'; $a++; print $a; 0002
then you can just use a regexp or substring to put chop and edit the version number.

                - Ant
                - Some of my best work - (1 2 3)