in reply to Re^2: How to use Perl in web pages?
in thread How to use Perl in web pages?

Actually there is no diference: it is the same Perl and the beauty of Perl is that you can do a lot without having to know all the ins-and-outs of the language. As you get more experienced you will start writing more efficient code of course by using the more advanced (some would say "arcane") constructs and techniques of Perl.

The basic structure of any Perl script that does "web"-things is easy:

  1. Your script is called by the web-server
  2. In your script you have access to the data of the request (preferably through a module such as CGI or CGI::Simple)
  3. You do something with this data and print the response (that could be as simple as some HTML-code to make a web-page or do some complex processing of form-data and update a database and then output the result as a web-page.
  4. Wash, Lather, Rinse, Repeat

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James