Perl is a powerful programming language that can be used for various web development needs. For instance, Perl can be used to extract information from a text file and then to print out a report. Or, it can also be used to convert a text file into another type of file. These are simple uses of the Perl language. However, this flexible language can also be used for more complicated applications such as systems programming. Any programs that are written in Perl are known as Perl scripts. The system program that is utilized to execute such Perl scripts is known as Perl program.
The main advantage of the Perl language is that it is not implemented as a compiled language but as an interpreted language. What this basically means is that when you make any alterations to a Perl script, you can view the result immediately. You don’t need to recompile the entire program every time you make a change as is the case in other programming languages such as C. This flexibility of the Perl language is what makes it extremely suitable for CGI scripting.
A CGI script is a small script that is executed on the server. It is typically used to create a web page that generates dynamically, including guest forms etc. CGI scripts are also used to pull information from particular databases.
To fully understand CGI, you need to understand how web browsing works.
When you click on a hyper link to visit a web page or a particular URL, the browser immediately contacts the HTTP web server and requests for the filename or the URL of the particular web page. The web server then tries to locate that particular URL so that it can send it back to the browser and you can view the web page you are looking for. However, if the web server is unable to locate the filename, it then sends back an error message to your browser. So essentially, the browser collects the response from the server and either returns the correct web page or the error message.
By using the Common Gateway Interface (CGI) and CGI scripts, it is possible to set up the HTTP server in such a way that that whenever a particular file is demanded, that file itself is not returned but the request is executed as a program instead. The output of that program is then sent back to the browser, which is what it displays.
To be able to use CGI programming, you need to ensure that your web server is capable of supporting CGI scripts and is thus configured.
Links
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment