Not to rain on anyone's parade, but this is something you don't need perl for at all -- not unless you need different data on each line. If your looking to repeat an element over and over and its completely static you have two other good choices:
- Use Server Side Includes. This requires they be turned on by your webhost. Many don't allow it for security reasons.
- Use the EMBED tag. The only real problem is only mozilla supports it properly for embedding HTML docs
- Use an IFRAME. This is prolly easiest solution
- Use the funky method described below
You can also do it with javascript... but then if the surfer has JS turned off... ouch?? So here's the JS way.
1) Make a .js doc thats all one line like this:
document.write("your HTML HERE");
2) in your main HTML doc where you want that file to be included you put the following line:
<script LANGUAGE="javascript" TYPE="text/javascript" SRC="include.js"></script>
For even MORE fun ... change the SRC to include.pl and write a perl file that dumps out 1 line of javascript which reads:
document.write("blahblahblah");
and you have a dynamic include. :-)
-Erik
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.