Harry Putnam wrote:
This has the right output but its not very obvious how one would use
this to increment a counter and files are being renamed.

As you would any other variable that contains a string.

  my $file = "$_.ext";

or

  my $file = $_ . '.ext';

or

  my $file = sprintf( '%s.ext', $_ );

or even

  my $file = sprintf( q/%03d.ext/, $_ );

though this sort of defeats the purpose of auto-incrementing a string.

--

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