in reply to adding 1 to a char of 1
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: adding 1 to a char of 1
by Anonymous Monk on Jun 20, 2006 at 17:38 UTC | |
by liverpole (Monsignor) on Jun 20, 2006 at 18:14 UTC | |
by Anonymous Monk on Jun 20, 2006 at 18:31 UTC | |
by ikegami (Patriarch) on Jun 20, 2006 at 20:47 UTC |