use Test::More qw/no_plan/; use HTML::Template; my $text = qq{Before. 1. 2. 3. After.}; eval { my $template = HTML::Template->new( debug => 0, scalarref => \$text, ); }; like($@, qr/found second tag/, "including 2 tags for one tmpl_if should throw an error");