Aesthetic reasons not withstanding, I'm not sure how you plan on resetting your counter without keeping track of which file you're working with in some way. There are some other things you might try, but from where I sit, you're going to wind up writing something resembling the code that you're trying to avoid.
I think there's something in PBP to the effect of "don't be elegant" anyway. The aesthetics you're working with today may not be the aesthetics you're working with a few months from now, or that the next guy uses. The code that you already know how to write and are trying to avoid, on the other hand, is pretty straight forward in what it does. That may be more meaningful for you in the future than whether or not it's pretty.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.