[EMAIL PROTECTED] wrote:

> I'm sorry, the previous subject should have been changed. My apologies.
>
>   while (<FILE>) {
>    $counter++;
> }
>
> I know this is probably simple, but how would I increment by 20? In other
> words, $counter would increment 1 time for every twenty lines of the file? Any
> help would be appreciated.

You probably need two counters then--one outside the loop, and one inside.  There
is a Perl variable that representsthe loop counter also, but you might as well be
explicit, since your focus seems to be on the loop count.

Can you tell us what your overall purose is?  That would give us a much better
idea of what advice to give.

Joseph


-- 
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