飛鳥 真一郎 > Template-Like-0.12 > Template::Like

Download:
Template-Like-0.12.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.12   Source  

NAME ^

Template::Like - Lightweight Template Engine.

SYNOPSIS ^

    #!/usr/bin/perl

    use lib 'lib';
    use strict;
    use Template::Like;

    my $input = q{
    [% var %]
    [% FOREACH var = vars %]
    - [% var.name %]
    [% END %]
    [% var %]
    [% IF bool %]TURE!![% ELSE %]FALSE!![% END %]
    [% UNLESS bool %]TURE!![% ELSE %]FALSE!![% END %]
    };

    my $param = {
      var  => "HOGE",
      vars => [ { name => "FOO" }, { name => "BAR" } ],
      bool => 1
    };

    my $t = Template::Like->new;

    my $output = "";

    $t->process(\$input, $param, \$output);

    print $output;

    exit;

result

    HOGE

    - FOO

    - BAR

    HOGE
    TURE!!
    FALSE!!

DESCRIPTION ^

Directive

GET
SET
USE
CALL
FOREACH
WHILE
IF
UNLESS
ELSIF
ELSE
END
FILTER
DUMMY
INSERT
INCLUDE
PROCESS

VMethods

scalar

defined
length
repeat
replace
match
search
split
list
hash
size
substr
html
uri

array

first
last
size
max
reverse
join
grep
sort
nsort
unshift
push
shift
pop
unique
merge
slice
splice
list

hash

keys
values
each
defined
exists
size
item
list

official http://www.template-like.org

SEE ALSO ^

Template

AUTHOR ^

Shinichiro Aska, <askadna@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2007 by Shinichiro Aska

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: