He was asking, what's the difference if my file has a .pl extension or .cgi
extension.

Answer, no difference as far as Perl itself is concerned.  It is the webserver
settings that matter.

To give you a couple of examples of where the difference is useful:

My ISP requires CGI scripts (whether written in Perl or anything else) to have
a .cgi extension.  The server is configured to only allow that.

A particular shopping cart package comes with both .cgi and .pl files.  If you
have control of the server it would not matter which is which if you set it up
that way.  But in looking at the files, it is helpful to easily be able to tell
which ones are called from a webpage (.cgi) and which ones (.pl) are called
secondarily by that cgi file or used locally as utilities, etc.

If you install ActivePerl on Windows, by default it configures .pl as
executable through the webserver, and not .cgi.  That's the reverse of the
norm, except that *nix and winders reverse of each other is normal I guess.  On
Windows I prefer to manually set it to use .cgi scripts instead of .pl.

Good question.  Sorry they gave you the bums rush.

Gary

> -----Original Message-----
> From: Randal L. Schwartz [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 2:50 PM
> To: [EMAIL PROTECTED]; Naveen Parmar
> Subject: Re: Perl and CGI
>
>
> >>>>> "Naveen" == Naveen Parmar <[EMAIL PROTECTED]> writes:
>
>     Naveen> What are the differences between Perl and CGI? Can I
> simply rename
>     Naveen> Perl files to .CGI and use them?
>
>     "What is the difference between a car and the road?"
>     "Can I simply call my car a road and drive on it?"
>
>     Naveen> What is the crossover from Perl to CGI?
>
>     "What connects the car to the road?"
>
> Perl is a programming language.  CGI is a defined interface between a
> web server and a process to handle form responses or (less frequently)
> server-side includes.
>
> They're not comparable or interchangable, any more than apples and
> apple stores are comparable.
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to