Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Auto Incrementing Variable in While Statementby htmanning (Friar) |
on Jan 23, 2007 at 04:47 UTC ( [id://596026]=perlquestion: print w/replies, xml ) | Need Help?? |
htmanning has asked for the wisdom of the Perl Monks concerning the following question:
I have a routine that grabs headlines from my database and then using a 'while' loop, writes the 10 latest headlines to a text file. I then include that file in an html page. What I'm trying to accomplish is to have a variable that auto-increments itself within the while loop so I can print something like:
Headline
Headline
Headline etc. I know that is a vague question but since I'm using the While loop, it simply zips through and writes the headlines down. I need to be able to have separate include statements so that I can plug ads in after every 3 headlines or so. Make sense? Thanks. Tom
Back to
Seekers of Perl Wisdom
|
|