in reply to Re: adding 1 to a char of 1
in thread adding 1 to a char of 1
my original number was 9 but now with the code u guys gave me, we incr +emented into 10. I need to plug this number back into the file name b +ut creating a new file called "name_0010" (originally it was "name_00 +09"). Here is the code I currently have, I know theres a more efficie +nt way to do this... $newfile = substr($newfile_n,0, 4); $newfile =~ s/^(0)+//; ++$newfile; print"$newfile\n"; $newfile = "000".$newfile; #if it gets to 100 then it will look like t +his "0100" substr($newfile, 1, 4);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: adding 1 to a char of 1
by liverpole (Monsignor) on Jun 20, 2006 at 18:14 UTC | |
by Anonymous Monk on Jun 20, 2006 at 18:31 UTC | |
|
Re^3: adding 1 to a char of 1
by ikegami (Patriarch) on Jun 20, 2006 at 20:47 UTC |