Web Programming

By: Jesse Miller

CGI programming is all about creating and using CGI scripts. In Perl programming, a CGI script is just a Perl program in a file that (typically) has the extension .CGI. Place CGI scripts on your internet service provider (ISP) web server and the scripts will create Web pages dynamically using Perl code, responding to user actions. Output will be sent to web browsers, not to the console.

Creating web pages on the fly can make your web pages come alive by using buttons, scrolling lists, pop menus, and much more. Using CGI, users can interact with your web pages, access databases, run programs, play games, and even make purchase on the web. Perl is the power behind interactive web pages for tens of thousands of programmers.

The beauty of CGI programming in Perl is that you use code to create the web page you want, responding dynamically to the user. Perl CGI programming is the same kind of programming used for your web pages but your code runs on a web server and not the console platform. Also, STDIN, STDOUT, and STDERR are not tied to the console. Other than that, it`s just Perl, so your previous skills in programming are applicable. The only change is the input/output, and it really isn`t terribly different.

The standard I/O file handles are different from programs which are programmed for console. The following list describes how STDIN, STDOUT, and STDERR are setup for CGI scripts.

STDIN provides the input to your script from HTML controls, like buttons, text fields, and scrolling lists. This information is encoded, and to parse this information, Perl modules like CGI.pm to fill variables with the data from a web page.

STDOUT goes back to thee user`s web browser. To create a new web page, you just print that Web page`s HTML to STDOUT directly or use the methods of modules like CGI.pm to create the HTML you want, and then send that to STDOUT. (It`s often easier to write the HTML using those methods than to write HTML all by oneself). In terms of making sure angle brackets match, the right tags enclose other ones, and so on).

Quick Note: Taking the Nonsense out of looking for the right spyware remover

If you really want to take the work out of looking for that right Spyware Protection from a go to the Internet and get a or a Free
Download, In order to prevent your vital information from being ripped from your computer get your Remover Today.

STDERR goes to Web Server`s error log. This is not very useful for the majority of CGI programmers because they don`t have easy access to their ISP`s server log. Redirect STDERR to STDOUT for debugging your program and easy access.

World Wide Web
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 

» More on World Wide Web
 



Share this article :
Click to see more related articles