![]() |
.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. |
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.
|
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 |
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. ?
|
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. |
| All times are GMT -5. The time now is 4:52 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC