it is i again
php style includes look like this:
include("templates/top.html");
include("templates/left.html");
include("templates/main.html");
include("templates/bottom.html");
my perl equivalent for several templates at a time
foreach $plate(keys %PLATES)
{
$TEMPLATES{$plate} = "template_folder/$plate";
if (open ($handle,"$TEMPLATES{$plate}) )<br>
{
$TEMPLATES{$plate} = <$handle>;<br>
close ($handle);<br>
}
}
print $TEMPLATE{'top'}
print $TEMPLATE{'left'}
print $TEMPLATE{'main'}
print $TEMPLATE{'bottom'}
this is a rough draft of what i'm trying to do, there might be some erros in the syntax but i'm sure you can grasp the concept. now this script is going to be called several times from a site menu with several different template options, (i'm just trying to make it simple for explantion purposes). which means that file opening and closing is going to happen very often, which will slow down the site. is there a better way of doing this? remind you, SSI is not an option, neither is CGI.pm, and no stander SQL style database is available.
the dumb boy seeks wisdom
............................................................................
If only there were evil people somewhere insidiously committing evil deeds
and it were necessary only to separate them from the rest of us and destroy
them. But the line dividing good and evil cuts through the heart of every
human being. And who is willing to destroy a piece of his own heart?
-Alexander Solzhenitsyn, novelist, Nobel laureate (1918- )
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.