From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

#!/usr/bin/env perl -w
use strict;
use Test::More qw( no_plan );
ok( my $t = Text::Template::Simple->new(), 'Got the object' );
my $file = File::Spec->catfile( qw( t data ), '028-dynamic.tts' );
ok( my $got = $t->compile( $file ), 'Compile' );
my $expect = 'Dynamic: KLF-->Perl ROCKS!<--MUMULAND';
is( $got, $expect, 'Dynamic include got params' );
use strict;
sub filter_foobar {
my $self = shift;
my $oref = shift;
${$oref} = sprintf '-->%s<--', ${$oref};
return;
}
sub filter_baz {
my $self = shift;
my $oref = shift;
${$oref} = sprintf 'KLF%sMUMULAND', ${$oref};
return;
}