View Single Post
  #2  
Old Monday, April 11, 2005
Argus's Avatar
Argus Argus is offline
Administrator
 
Join Date: Mar 2000
Location: Islamabad
Posts: 702
Thanks: 351
Thanked 2,445 Times in 282 Posts
Argus is a splendid one to beholdArgus is a splendid one to beholdArgus is a splendid one to beholdArgus is a splendid one to beholdArgus is a splendid one to beholdArgus is a splendid one to beholdArgus is a splendid one to behold
Default Topics (CS)

CGI refers Common Gateway Interface. It is one of the earliest scripting languages .a CGI application runs entirely on server,and can be used to create dynamic web applications. CGI programs are small executables, that the server executes in response to a request from a browser.it is most common application in the forms processing.CGI allows you to create pages for users as individual requests come in , and you can customize pages to match that information.

Perl : it is a language with powerfull text-processing capabillities.Perl is undoubtedly the most common language used for scripting CGI.
i don't have any practical exposure abt perl that's why i m giving you some theoritical knowledge regarding this.the matter of the fact is that now CGI is loosing its market just because of its extra overhead on server and ISAPI is taking its place; well proceed further..

most of CGI is just standard Perl, with a few changes here and there .

CGIs process input differently than old Perl scripting does - and this is the only difference you'll find between the two. Once the CGI scripts process the input, it becomes data, which is treated pretty much the same way by both CGI and Perl scripts. CGI input can be retrieved in two different ways: "get" and "post."

Perl has allowed us to provide a very easy to use and enjoyable interface to our database servers. The servers are actually on NT running a proprietary database software package. The database software is very good at performing both full text and exact term searches of the term data. However, the software interface to the database engines is weak and unusable at best. By using Perl to talk to the database server's HTTP interface we were able to extract the desired results data and then use Perl's power to reformat the results into something pleasing and tailored to the user's preferences.

we can write Perl script on texteditor.it is possible to write simple programs in Perl with minimum of effort.

As we can write CGI programs in c++,c but perl is mostly preffered.

Perl is a full fledged programming language.It was desgined with an objective to make dynamic and smart web pages.
It has an extensive structure handling feature.Syntaxwise this language is short but its library makes it like C.I mean short but powerful.Here is an exaple:
This is a program written in Perl which will take user input for two enteries and will add them,
1 print "Please Enter 1st no to add:\n";'\n is to move to the other line with out printing it, the messages doesn't matter how many times u use the print statement will print on the same line[like C]'
3 $number1=<STDIN>;'causes execution of the program whilw the computer is waiting for user input'
4 chomp $number1;'removes charecter/no from the ending of the line placed as the input[previous input](for new entry)'[I take this to be an ambiguity and should be removed by making its compiler powerful and understanding that a new input is supposed to be made so clear the previous input so that syntax becomes shorter like we do this in C]
6 print "Please enter second no:";
8 $number2=<STDIN>;
10 chomp $number2;
13 $sum=$number1+$number2;
print "The sum is $sum";'no need to express format type as the variable is scaler and is defined wherever need'
Now that was a sample program.If I am asked to compare its syntax with some language.It would certainly be the Basic.
Now a brief account of Perl's programming approach.
Programs may be written in different ways and Perl is a highly portable language.Its code is easy to understand.
Perl 3, 4 and 5 and 6 are the versions available in the market but Perl 6 is the latest in use.Perl 6 (2000)is a complete rewrite of internals and externals after complete re-organization of done in its previous version.

(Thanx yushrah and ABK Jun 2002)

Last edited by Argus; Monday, April 11, 2005 at 09:24 PM.
Reply With Quote
The Following User Says Thank You to Argus For This Useful Post:
Austere (Tuesday, June 19, 2012)