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