— |
use_ok( 'HTML::Template' );
my $tmp = File::Temp->new( UNLINK => 1, SUFFIX => '.tmpl' );
ok(copy(catfile(curdir, 'templates' , 'simple.tmpl' ), $tmp ), "copied simple.tmpl to temp file" );
my ( $output , $template );
$template = HTML::Template->new(
filename => $tmp ,
blind_cache => 1,
debug => 0,
cache_debug => 0,
);
$template ->param( ADJECTIVE => sub { return 'v' . '1e' . '2r' . '3y' ; });
$output = $template ->output;
sleep 1;
ok(copy(catfile(curdir, 'templates' , 'simplemod.tmpl' ), $tmp ), "poured new content into template to test blind_cache" );
$template = HTML::Template->new(
filename => $tmp ,
blind_cache => 1,
debug => 0,
cache_debug => 0,
);
ok( $output =~ /v1e2r3y/, "output unchanged as expected" );
|