Home | All Questions | alt.html FAQ > Perl

What is the difference between CGI and Perl?

The Common Gateway Interface (CGI) is a specification that allows a webpage to communicate with a server side script. Typically the server side script then dynamically creates the next page as its output. A CGI script can be written in any programming language that can read from a standard input device and write to a standard output device.

Perl is a programming language written by Larry Wall in the eighties as a glue language to be used by system administrators to automate report generating and other administrative functions. When the web evolved and CGI became available, the first scripts were written by webmasters who were mostly system administrators. Typically, they used the programming language that they knew quite well to deliver interactive content, thus Perl became one of the main scripting languages for CGI.

#!/usr/bin/perl

while ('CGI' eq 'Perl' || 'Perl' eq 'CGI') {
  print "Oops. Wrong Universe.\n";
}

print "First lesson complete.\n";

Recommended Resources

Discussion

Related Questions