#!/usr/bin/perl
use strict; use warnings;
use Inline TT2 => 'DATA';
print hello( { name => 'Rob' } ), "\n";
# prints '
Hello Rob, how are you?
'
print goodbye( { name => 'Mr. Mitchell' } ), "\n";
# print ' Goodbye Mr. Mitchell, have a nice day.
'
# Note that in all cases, there is a lot of trimming. This includes:
# Removing any text left over when template directives are removed by tt2
# Stripping all leading and trailing spaces.
# At present these are not configurable.
__DATA__
__TT2__
[% BLOCK hello %]
Hello [% name %], how are you?
[% END %]
[% BLOCK goodbye %]
Goodbye [% name %], have a nice day.
[% END %]