On Apr 10, Michael Gargiullo said:

>I have a loop that starts at 0 and goes to 99999 and sets the variable $zip
>to the current number
>
>I need it to always be 5 places like a zip code, like so
>
>00000
>00001
>etc...
>
>How can I do that?

Here are two ways:

  # makes a VERY LARGE LIST
  for $id ('00000' .. '99999') { ... }

  # probably faster
  for ($id = '00000'; $id ne '100000'; $id++) { ... }

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to