2 # (c) Petr Baudis <pasky@suse.cz>
13 # Ultra-trivial templating engine
16 my $pathinfo = $ENV{PATH_INFO
};
18 my $gcgi = Girocco
::CGI
->new('HTML Templater');
19 print "<p>Hi, this is your friendly HTML templater speaking. Pass me template name.</p>\n";
23 unless ($pathinfo !~ m
#\./# and open(TEMPLATE, "$Girocco::Config::basedir/html/$pathinfo")) {
24 my $gcgi = Girocco
::CGI
->new('HTML Templater');
25 print "<p>Invalid template name.</p>\n";
29 my ($gcgi, $section, $heading);
33 if (s/^\@section=//) {
36 } elsif (s/^\@heading=//) {
39 } elsif (s/^\@header//) {
40 $gcgi = Girocco
::CGI
->new($heading, $section);
49 $gcgi and $gcgi->srcname("html/$pathinfo");