I'm trying to decide what the easiest (and most realistic) way to design my stie would be.

All of my pages have a top area that is always the same, a left menu that is always the same, and then a right menu that changes depending on whether or not the user is logged in (and the way that it changes is unique to every user, so part of the right frame must be generated by a PERL script on every execution). The contents of the page being displayed is in the middle of the page. I'm not using frames, just tables to split the page all up so that it kind of appears that way.

I was going to use SSI and just include the portions of pages that need to be generated by script, but have come to the conclusion that it MIGHT be better to just make all pages PERL generated using HTML::Template, instead of only those absolutely necessary.

If I use a .shtml file to create a page, I theoretically would need to do...
!--#include virtual="/cgi-bin/top.cgi"--

.... page content .... OR !--#include virtual="/cgi-bin/scriptToCreatePageContent.cgi"--

!--#include virtual="/cgi-bin/bottom.cgi"--

top.cgi basically just creates a HTML::Template and displays it. bottom.cgi would create the user-unique menus, and display them via HTML::Template as well.

What I've figured is that if I do this method, every time a page is called, the page is loaded, but 2-3 CGI scripts are executed as well. If I create all of my pages using a PERL script, I could do all the executions within 1 script (but would need to use either "require" or "do" so that I could pull subroutines for another script to generate the top and bottom, in case I wanted to modify the top or bottom without having to edit every single page/script.

Basically, I want to make sure that my site is relatively efficient, so that my host doesn't contact me down the road, and tell me that I'm bogging down their server & need to recode everything.

All the Perl scripts are pretty simple for these pages. One does a quick loop for something, before spitting out an HTML::Template, the other just prints out an HTML::Template... with only a little different based on whether or not the user is logged in.

My questions:
1) If I get several thousand visitors a day browsing through my site (say for a total of 20,000 impressions per day), am I risking that these scripts be too demanding on a shared hosting server that my host contacts me to recode them? I don't think that such simple scripts would be very demanding, but at the same time... a large quantity of impressions may be a different story.

2) What's the different between 'require' and 'do'? It seems like they basically do the same time, or at least can... for what I need them to (which is including subroutines defined in another file into a script). From a performance standpoint, is there much of a difference?

Any feedback/help would be greatly appreciated guys.

Just learnin' as I go, and trying to learn it right.. the first time.

Thanks Monks!


Steny

In reply to 'require' vs. 'do' vs. SSI include by Steny

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.