views:

216

answers:

4

What does it mean when I access my Perl script via URL, but when I do, the source code is printed on the screen?

Does this mean that Perl isn't properly set up? I'm using Apache on Fedora.

+13  A: 

This means your webserver isn't set up to execute the script at that url. What server are you using?

Dan Lorenc
It is Apache, on Fedora Red Hat.
See this guide: http://www.thesitewizard.com/archive/addcgitoapache.shtml
Dan Lorenc
+4  A: 

It could also mean you are putting the Perl script in the wrong folder. The cgi-bin folder is still widely used as the folder where CGI scripts should be stored and run from. Other folders may just open the file and read it as text, similar to an HTML document, instead of running the document as code. But it can also mean the server is just not setup properly to run Perl scripts or other types of server-side scripts.

+2  A: 

This means that you probably aren't doing what your server is expecting. Usually servers expect either that every file in a CGI directory is an executable, or that files with a certain extension are executable and it can serve any other file as its content.

Figure out which file extension your server expects your CGI program to use.

brian d foy
A: 

Ovid's CGI Course may help you (if you use CGI of course)

Alexandr Ciornii