Thanks for your comments! I was in a bit of a hurry when I made the post(at work!) but more of a factor in my admittedly poor post is my lack of programming knowledge! I have since had more time to look at it and this is what I make of it!
So firstly, I must place the headings in html heading elements "h2" etc, could I use a pattern match e.g.
if $line = 1 or more blank lines followed by a single line with letter characters in it(the heading, usually comes in this form) followed by 1 or more blank lines. Then save that line with characters in it in to a variable (say $saved) then print "h2 ($saved) h2".
The same for words that are supposed to be in italics(which in this case are underscore characters in the text), I could again use a pattern match but with
"s/\_/(html italics element)/g;. The problem with this approach is that the match would convert all instances of underscores into the opening italic element but not the closing element. Does that make sense, basically after the first instance was changed all the letters in the text (after the italic element) would be in italics?
Also, how would I place the whole text into html, head, body elements etc, I just can't figure out how to have both opening and closing elements!
I know I have not put the problem very clearly, but I hope you can get an idea of what I have to do.
I am going to try to work on some pseudo to make it a bit clearer!
Thanks!
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.