Hola monks! I'm newbie programmer, Perl being my first learned language, and I working on a project at work that I'm having a problem with. I'm doing sort of a publication type thing but on a way smaller scale. I'm using text files with newline delimination for just plain easiness. If there's a better way, trying to stay away db's, smack me.
Anyway, I collect the info from the text file into an array through a open() command. I use some of the array throughout embedded html code (i.e. name, date written, author, etc), but the last part is the actual article (The idea is that paragraphs are also deliminated by newlines). Because the # of para's will change with the writer, I need to be able to just iterate over the list, but I don't want to display the whole array ($array[4] and beyond). I've tried for(), while(), and foreach(), with no luck.
If you can help, that would be great! I may just be an idiot, but I'm ok with that.
-Ryan
The array set up like this:
@array = ("img", "title", "date", "author", "para(1)",..."para(n)")
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.