Harry Putnam wrote:
Taking the chicken way out... but I can't think of the right tricky
search strings to uncover a tried and true way to output a 3 digit
padded numeric series.  In this case its for file names.  And needs to
roll over to 4 digit in the event there are enough files.

There is no problem of clobbering since files are being renamed as
they are moved to a new clean directory.  I just can't recall how to
make my incremented counter start at 000 and go:
001.ext
002.ext
003.ext
 etc.

Its just the numeric part I need a jump start on.



Believe it or not, write the number as a string.

#!/usr/bin/perl

use strict;
use warnings;

for ( '000' .. '100' ){
  print "$_\n";
}

__END__




--

Just my 0.00000002 million dollars worth,
   --- Shawn

"Probability is now one. Any problems that are left are your own."
  SS Heart of Gold, _The Hitchhiker's Guide to the Galaxy_

"This statement is true but unprovable."
  Kurt Godel

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to