February 2006
Intermediate to advanced
304 pages
6h 16m
English
This is the CGI version of "Hello World." In spite of it being a very simple program, it is extremely useful. Why? Because if you can run it, you know that your server is properly configured to run CGI programs. And from bitter experience I can tell you that sometimes configuring the server is half the battle.
1 #!/usr/bin/perl -T 2 3 use strict; 4 use warnings; 5 6 print <<EOF 7 Content-type: text/html 8 9 <HEAD><TITLE>Hello</TITLE></HEAD> 10 <BODY> 11 <P> 12 Hello World! 13 </BODY> 14 15 EOF
To run the script, just point your web browser at the correct URL. If you are using the default Apache configuration, the script resides in ~apache/cgi-bin/hello.pl and the URL to run it is http://server/cgi-bin/hello.pl ...
Read now
Unlock full access