Or this can be further simplified: while (<FILE>) { $counter += 20; }
The += operator is equivilent to saying add the value then assign it to the variable. Tim Donahue > -----Original Message----- > From: Chance Ervin [mailto:[EMAIL PROTECTED] > Sent: Monday, March 29, 2004 1:03 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: Incrementing count > > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, March 29, 2004 6:20 AM > Subject: Incrementing count > > > > 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. > > > > while (<FILE>) { > $counter=$counter +20; > } > > -- > ----------------------------- > InteleNet Communications Inc. "Help me help you." > Chance Ervin - SCSA -- Jerry Maguire > Oracle Certified Professional > Operations Supervisor > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>