Lobo Louie has asked for the wisdom of the Perl Monks concerning the following question:

I haven't configured a Perl script in about 2 years. Since then, I've slept about 600 times, thus I have forgotten my shallow Perl knowledge, so please bear with me. When does a script require a .pl or .cgi extension? The script I am trying now has .pl, but my server seems to require .cgi. My server has several flavors of perl at /user/bin/perl: perl, perl5 and perl5.0503. Do I configure the line that reads #!/usr/bin/perl as: #!/usr/bin/perl #!/usr/bin/perl5 #!/usr/bin/perl5.0503 (The first two work). When try to run Perlfect's Search script in my HTML, I don't get 400 or 500 series errors, my browser just displays the search.cgi script. I know I'm missing something simple, I just haven't figured it out yet. TIA

Replies are listed 'Best First'.
RE: Basic Questions
by Anonymous Monk on Jan 03, 2000 at 07:18 UTC
    >When does a script require a .pl or .cgi extension? It depends on the setting of the web server it is being used with - if the web server only knows that .pl files get run with Perl, only files with those endings will work. >Do I configure the line that reads #!/usr/ >bin/perl as: #!/usr/bin/perl #!/usr/bin/perl5 #!/usr/bin/perl5.0503 >(The first two work). That directive notes where the perl executable is, so that it can be used with the script. This is usually only needed with Unixish platforms. (though I thin Apache on Win32 needs it for some reason... I don't recall.) If it works right, it works right. /usr/bin/perl is probably linked to the most recent version of Perl on you machine, so it should function right.