- Make sure that your script begins with the line: #!/usr/bin/perl -w
- Then enter any of the use statements that your script relies on
- Under the use statements enter the following line: print “Content-type: text/html\n\n”;
- Under that line you enter the main part of your script.
- Upload your script to the cgi-bin directory of your web server.
- Change the permissions on the script to 755. This is VERY important, JustHost servers require the permissions of CGI files to be set to 755. You can set this from any ftp client, or form inside the File Manager section of your JustHost cPanel.
- That’s it! Your script should now run if you point your browser to the address (probably http://YOURDOMAIN.com/cgi-bin/YOURSCRIPT.cgi)
Some Additional Notes
You can install perl modules from inside cPanel (in the Perl Modules section.) To make sure that your script picks up all of these installed modules, you must add the following chunk of code immediately under the first line of your script: