Others have commented on the Perl side of this, and the advantages to code maintenance of one approach or the other, but I'd like to add another consideration: the web side. It's the sort of theoretically minor thing that could easily be overlooked, but depending on your situation it could be significant.

If you do the whole thing as one big script, all the parts of it will have the same URI; if you split it up into multiple scripts, they won't. (Another poster spoke of splitting out various modules and having the main script load those it needs; that hybrid approach could be made to fall, from the web's perspective, into the one-big-script category. Conversely, if you use GET, one script may have different URIs.)

So you want to ask yourself, does it matter whether the various pieces have the same URI or not? If two pages have the same URI, it has a lot of effects. The browser will treat them the same for bookmarking purposes. Do you want to be able to bookmark the "add comment" page, for convenience, or do you want the user to have to go through the main page every time? Any forms they contain will probably get treated as the same page of forms by browsers that have autofill features. Is that good, or bad, in your circumstances? There may also be more subtle effects; a page that has the same URI as an earlier page may force the earlier page out of a browser's cache, for example. These sorts of things are IMO well worth considering when you decide whether to put various parts of your site in the same script or separate them.

 --jonadab


In reply to Re: One Big Script v. Several Small Scripts by jonadab
in thread One Big Script v. Several Small Scripts by Cody Pendant

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.