This tutorial is not about using proper syntax for CGI/Perl, but rather configuring your scripts to run properly on our server.
Setting your permissions on your CGI scripts properly.
If you plan on running or linking to CGI scripts using the above method, set your permissions accordingly:
CGI FILE -- 700 or (Owner=execute/write/read, group=nothing, world=nothing)
DATA FILE that the script writes to but is not viewed on the web) -- 600 or (Owner=write/read, group=nothing, world=nothing)
DATA FILE that the script writes to and is viewed on the web (example: guestbook) -- 644 or (Owner=read/write, group=read, world=read)
The above permissions will ensure MAXIMUM security.
Note: NEVER set your permissions on a file or directory to 777 as our server will not allow the script to execute because of the potential security hazard.
Back to the top.
Using the correct extensions for your CGI scripts.
If you are using a CGI script that you plan on being viewable by anyone (that creates output in the form of HTML), the script must have the .cgi file extension. If you try to do this with the .pl extension, it will not work.
The ..pl extension will work in all other cases. However, we strongly suggest you use and only use the .cgi extension for your Perl scripts. This is a good habit and will factor out any problems relating to your scripts because of the file extension used.
Back to the top.