1 #!/usr/npac/bin/perl -w 2 # 3 # File: helloWorld.pl 4 5 use CGI qw(:standard); 6 7 $date = `date`; # Unix 'date' utility 8 $hostpath = "http://www.npac.syr.edu/projects/tutorials/CGI/examples/basic-cgi"; 9 10 # Print MIME header: 11 print header(); 12 13 # Print first few lines of the HTML document: 14 print start_html( 15 -title=>'CGI Example: Hello World!', 16 -BGCOLOR=>'#ffffff' 17 ), "\n"; 18 19 # Print a heading: 20 print h1('Hello World!'), "\n"; 21 22 # Print the date: 23 print p( "This program was run on $date" ), "\n"; 24 25 # Print a horizontal rule: 26 print hr(); 27 28 # Print a link: 29 print 'Return to '; 30 print a({HREF=>"$hostpath/helloWorld0.html"}, 31 'HTML form' 32 ), "\n"; 33 34 # Print last few lines of the HTML document: 35 print end_html(), "\n";