Sample Perl script for testing

A sample Perl script for testing on your account.

The following Perl script is bug free and can be used for testing if Perl is working on your account.

#!/usr/bin/perl

# hello.pl -- my first perl script!

print "Content-type: text/html\n\n";

print <<"EOF";
<HTML>

<HEAD>
<TITLE>Hello, world!</TITLE>
</HEAD>

<BODY>
<H1>Hello, world!</H1>
</BODY>

</HTML>
EOF
 
  1. Create a new file and copy the above script into it
  2. Save it as “hello.cgi” or “hello.pl”
  3. With your FTP program
    1. Upload it to your “public_html” folder
    2. Change the modification privileges (chmod) to 755
  4. Try access it in your web browser (e.g. http://yourname.zenutech.com/hello.cgi)
Posted 2008-03-25 in Web Development