1 @# A test program for Temple
2 @# starts with a couple of comments
4 @# The language is very simple -- everything except the "@" character
5 @# gets passed to the output verbatim:
8 @# The "@" starts a control sequence. Arguments of control sequences
9 @# are either everything to the end of the current line (as in case
10 @# of the comment command you are looking at) balanced parenthesized
14 @# If we want to ignore and end of line character, just prefix it by "@":
19 @# If you want to write the "@" character, just write it twice:
22 @# You can embed any perl code in your text:
23 @[foreach $x (1..10) { print "$x "; } ]
25 @# Or if you use @{...}, then the value of the last expression executed
26 @# gets printed automatically:
27 @{"1+2+3 = " . (1+2+3)}
29 @# You can also interpolate perl variables by using @$variable:
32 @# It is possible to call any perl functions (result will be discarded):
33 @print("One", "Two", "Three\n")
35 @# Or do the same with parameters running up to the end of the line:
36 @print "Four", "Five", "Six\n"
38 @# There are also some conditionals (you can use any perl expressions):
51 @# Or you can use the parenthesized form:
52 @if(0)ONE@else()TWO@fi()THREE
54 @# To include another file (and possibly change some variables), use:
55 @include("test2", "a" => "HOWDY", "b" => "HULLO", "c" => "AHOY")
56 @include "test2", "a" => "howdy", "b" => "hullo", "c" => "ahoy"
58 @# And to load a perl file:
61 @# This one is tricky: