#!/usr/bin/perl use warnings; use strict; use Template; my $tt = Template->new({ EVAL_PERL => 1, INCLUDE_PATH => 'templates', PRE_PROCESS => 'config', PRE_CHOMP => 1, POST_CHOMP => 1 }); my $page = $ENV{'REQUEST_URI'} || 'home'; my $script = $ENV{'SCRIPT_NAME'}; $page =~ s{^$script/}{}; $page = 'home' if $page =~ m{\*|\?|/}; # elite security my $vars = { page => $page }; print "Content-Type: text/html\n\n"; $tt->process('wrapper', $vars) || error($tt->error); sub error { my $error = shift; print <
Something has gone wrong. Here's what Template Toolkit had to say:
$errorHTML }