![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2008
Posts: 23
Rep Power: 0
![]() |
.cgi Vs .pl
What's the difference between cgi and perl. I am confused between the two. The file with ext .cgi is using the perl code. It runs too.
But the file with ext .pl , and containing the perl code doesnot run ? What's it's significance. |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Nov 2007
Posts: 74
Rep Power: 1
![]() |
Re: .cgi Vs .pl
file extensions are mostly meaningless. windows maintains a map between file extensions and the programs which should be used to open them. apache web server does something similar. CGI is an interface agreed upon by rfc 3875. it is used to pass information from web requests to executables. CGI can pass data to any type of executable which can understand it. your .cgi files are probably parsed for a #! line which maps your particular .cgi file to be executed by perl. in short, file extensions are pretty much meaningless.
|
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
Re: .cgi Vs .pl
The extension just tells the server how to handle it. cgi extensions tell it to run the script with whatever program is listed at the top #! line. If the server is not told to do the same with .pl files then it will not know what to do with it.
If you are on an apache server, adding this line to the .htaccess file in the folder will make it parse .pl files through CGI AddHandler cgi-script .pl
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi freelance scripts - http://ryanguthrie.com/index.html |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Jan 2008
Posts: 23
Rep Power: 0
![]() |
Re: .cgi Vs .pl
Actually I am not able to run test.pl ( in cgi-bin/test.pl). However files with .cgi run successfully. So should i rename test.pl to test.cgi. Is CGI file and Pl file one and the same. ?
|
|
|
|
|
|
#5 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,724
Rep Power: 5
![]() |
Re: .cgi Vs .pl
The fact that the .pl extention does not work, would be the result of Apache's configuration. It is not currently set up to recognize the .pl extention as a valid cgi-script. This configuration is controlled in the
httpd.conf file.For now, if you use the .cgi exention, and link the file to the Perl interpreter with the proper Shebang (#!), it should work fine. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|