From template:
[% message %]
#### #!/usr/bin/env perl use strict; use warnings; use Template; my $tname = 'templates/form.html'; my $vars = { message => "Hello World\n" }; my $template = Template->new({ INCLUDE_PATH => '/Users/7stud/perl_programs/cgi_projects/1proj') }); $template->process($file, $vars) or die "*MY* template process failed: ", $template->error(), "\n"; #### 1proj/ ---cgi-bin/ ------create_form.pl -------simple_cgi.pl ---serverHTTP.py ---templates/ -------footer.html -------form.html -------header.html ------xform.html 2 directories, 8 files #### #!/usr/bin/env perl use strict; use warnings; use Template; my $tname = 'templates/form.html'; my $vars = { message => "Hello World\n" }; my $template = Template->new({ INCLUDE_PATH => '/Users/7stud/perl_programs/cgi_projects/1proj') }); $template->process($file, $vars) or die "*MY* template process failed: ", $template->error(), "\n"; #### http://localhost:8000/cgi-bin/create_form.pl #### http://localhost:8000/cgi-bin/simple_cgi.pl #### #!/usr/bin/env perl use strict; use warnings; use CGI; use CGI::Carp qw{ fatalsToBrowser }; my $cgi = CGI->new; print $cgi->header, $cgi->start_html, $cgi->div('hello'), $cgi->end_html;