Hello!

I am very new to Perl and CGI scripting. I know a fair bit of the Perl language but I'm having trouble putting together a CGI-driven website.

How are CGI-run websites usually organized? Is there a single script that is called when a user visits the website, and then that single script will perform all the website functions like accepting inputs, writing to a database and generating html for all the pages?

Or, is there a directory of perl scripts that are embedded into the html pages of the website? And they can each pass info to each other?

Currently I have it set up so that index.html has a Perl script embedded in the center and it outputs all the main content, but how do I make it clear the page or switch to another script, and is that even a good idea?

My goal is to make a server-side Perl program that will accept inputs from a web page, do several computations with these inputs, and then post the results in HTML (and eventually SVG) and continuously do this on the same page without having to refresh.


In reply to CGI layout by marlin

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.