#!/usr/bin/perl use strict; use warnings; use CGI; my $cgi = new CGI; print_document_header(); print_document(); ###################################################################### sub print_document_header { ###################################################################### print $cgi->header( -type => 'text/html' ), "\n"; } ###################################################################### sub print_document { ###################################################################### print $cgi->start_html( -dtd => '-//W3C//DTD HTML 4.01 Transitional//EN', -title => 'Hello, world!', ), "\n", $cgi->p( 'Hello, world!' ), "\n", $cgi->end_html(); } #### ###################################################################### sub print_document_header { ###################################################################### my $cgi = shift @_; print $cgi->header( -type => 'text/html' ), "\n"; }