package interface; use CGI::Carp qw(set_die_handler); BEGIN { sub handle_errors { my $msg = shift; print "content-type: text/html\n\n"; print "$msg"; } set_die_handler(\&handle_errors); } use strict; use warnings; use Template; use DBI; eval { ($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX / or Windows / ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \ do 'config.do'; do 'templates.do'; do 'shared.do'; do 'database.do'; }; my $config = { INCLUDE_PATH => "$config::templatesAbs", INTERPOLATE => 1, POST_CHOMP => 1, }; print "Content-type:text/html\n\n"; my $template = Template->new($config); my $vars = { images => "$config::imagesUrl", }; my $input = 'welcome.htm'; $template->process($input,$vars) || die $template->error();