]> mj.ucw.cz Git - temple.git/blob - temple
UCW::Temple::CGI: Added html_template().
[temple.git] / temple
1 #!/usr/bin/perl
2 # A really simple template engine
3 # (c) 2004 Martin Mares <mj@ucw.cz>
4
5 use strict;
6 use warnings;
7
8 use Getopt::Long;
9 use UCW::Temple;
10
11 my $out;
12
13 GetOptions('out|o=s' => \$out) or die "Usage: temple [-o <out>] <in> ...";
14 if (defined $out) {
15         close STDOUT;
16         open STDOUT, ">$out" or die "Cannot open $out: $!";
17 }
18 if (!@ARGV) { push @ARGV, "-"; }
19 UCW::Temple::start(undef);
20 foreach (@ARGV) {
21         UCW::Temple::parse_file($_);
22 }
23 UCW::Temple::finish();