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;
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
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
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++)
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