Re: Help with leading zeros!

2001-04-06 Thread Glenn Linderman
Actually, it isn't the $i++. It was the $i 501. Particularly, the . Switching to $i lt '501' produces the sequence with leading zeros intact. for ( $i = "001"; $i lt "501"; $i++ ) Cheers! "$Bill Luebkert" wrote: Glenn Linderman wrote: Doesn't he need for ( $i="001"; $i 501;

Re: Help with leading zeros!

2001-04-06 Thread Ron Grabowski
for ( $i = "001"; $i lt "501"; $i++ ) I think there's something to be said about using numbers that are really strings as numbers. Specifically that it might not be the RightThing to do. There seems to be an aweful lot of unnecessary conversion going on. printf()'s formatting was designed for

Re: Help with leading zeros!

2001-04-06 Thread dave . clarke
for ( $i = "001"; $i lt "501"; $i++ ) I think there's something to be said about using numbers that are really strings as numbers. Specifically that it might not be the RightThing to do. There seems to be an aweful lot of unnecessary conversion going on. Here, Here. printf()'s

Re: Help with leading zeros!

2001-04-06 Thread Ron Grabowski
close STDERR; open (STDERR, "NUL"); That's what I wanted to do. timethese( 5000 , { 'NumsAsStrings' = 'for ( $i = "001"; $i lt "501"; $i++ ) {print STDERR $i}', 'NumsAsNums1' = 'for ( 1 .. 501 ) {printf STDERR "%03d", $_};', 'NumsAsNums2' = 'for ( $i=1; $i501;$i++)

Re: Help with leading zeros!

2001-04-06 Thread $Bill Luebkert
Glenn Linderman wrote: Actually, it isn't the $i++. It was the $i 501. Particularly, the . Switching to $i lt '501' produces the sequence with leading zeros intact. for ( $i = "001"; $i lt "501"; $i++ ) You're absolutely right that I'm wrong. :) I thought the inc would change the