Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: How to use Perl in web pages?

by CountZero (Bishop)
on Jun 07, 2009 at 07:21 UTC ( [id://769237]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://769237]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found