CGI Scripts
to Create a Website with Interactive Features

hello_script.pl

This script will print the words Hello World on the computer screen.

#!/usr/bin/perl #This is the shebang line
print "Content-type:text/html\n\n";

print "<html>\n";
print "<head><title>Hello World</title></head>\n";
print "<body>\n";
print "<h1>Hello, world!</h1>\n";
print "</body>\n";
print "</html>\n";



Note: If the scripts don't work:
1...Check the shebang line and make sure it is the path recommended by your web host to access the perl interpreter on your server.
2...Be sure to use the Chmod function on your ftp client or file manager to change the permissions of the script to 755


How to Test Scripts on Your PC

In order to test scripts of any kind, Perl, PHP or MySQL, on your PC, you'll need to set up a localhost server.
See: Localhost Server
Then read my tutorial on setting up your server to work with the HTMLPad 2010 html editor.