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; $i++ ) {print "$i\n"}
> >
> > due to his comment about a string of alpha & numbers ????  $i++ is supposed to be 
>"magical" on
> > strings, not affecting their length.  But the above doesn't work (Win32, 
>ActiveState perl 5.6
> > build 623); the first time it _does_ get 001 (with the quotes), but the second 
>time is just
> > plain "2".
>
> The $i++ causes that.
>
> --
>   ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
>  (_/   /  )    // //       DBE Collectibles   http://www.todbe.com/
>   / ) /--<  o // //      Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
> -/-' /___/_<_</_</_    http://www.freeyellow.com/members/dbecoll/

--
Glenn
=====
Even if you're on the right track,
you'll get run over if you just sit there.
                       -- Will Rogers


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to