To strip leading zeros:$x = 1; ++$x; # produces 2 or "2" (transparent which) $x = "1"; ++$x; # the same $x = "A"; ++$x; # produces B
see the perlop documentation for more details.$char =~ s/^(0)+//;
-M
Free your mind
In reply to Re: adding 1 to a char of 1
by Moron
in thread adding 1 to a char of 1
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |