For most websites, HTML (or XHTML) is the most important thing you'll be serving up.

That HTML might be static (i.e. you write the HTML on your computer, upload it to your server, and it becomes part of your site) or dynamic (i.e. you write a script on your computer, upload it to your server, and the script produces HTML as its output).

You can generally write such scripts in whatever programming language your server will be able to run. Perl is one such language - and I'd expect it to be the first choice of most of the monks here.

You'd typically then supplement the HTML with CSS to control how it looks, and possibly with Javascript to control the behaviour of the pages (e.g. make forms more interactive, add drop-down menus, etc).

What is CGI? It stands for Common Gateway Interface. It's a standardised set of conventions for a web server (such as Apache) to "talk" to a script. It basically involves the server stuffing a bunch of useful information into environment variables, executing the script, reading data from the script's STDOUT, and sending that data back to the browser.

CGI.pm (see CGI) is a Perl module that makes it easier to write scripts that will be spoken to via CGI. It deals with extracting data from environment variables, etc.

CGI is just one way that a web server can talk to your script. Although it's simple, flexible, very widely supported, and well-known, it does also have its drawbacks. Each request for a page will run your script fresh. If your script needs to do a lot of initialisation (e.g. loading modules, opening database connections, etc) this can be pretty slow - it can be preferable to have a script which starts once and is able to serve up many pages. Solutions like mod_perl and FastCGI can help here.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

In reply to Re: Web-designing using PERL by tobyink
in thread Web-designing using PERL by Arthes

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.