You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've been using Template-Toolkit for many years.
I'm having trouble debugging when using OUTLINE mode.
I can't get the correct line number in debug mode.
example.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Template;
use Template::Parser;
use Template::Directive;
$Template::Parser::DEBUG = 1;
$Template::Directive::PRETTY = 1;
my $tt = Template->new( { STRICT => 1, OUTLINE_TAG=>'%%' });
my $var = { title=>"TITLE" };
$tt->process(\*DATA, $var) or die $tt->error(), "\n";
__DATA__
%%
%%
%%
%%
%% title
result
[Template::Parser] compiled main template document block:
sub {
my $context = shift || die "template sub called without context\n";
my $stash = $context->stash;
my $output = '';
my $_tt_error;
eval { BLOCK: {
#line 1 "input file handle"
$output .= $stash->get('title');
} };
if ($@) {
$_tt_error = $context->catch($@, \$output);
die $_tt_error unless $_tt_error->type eq 'return';
}
return $output;
}
TITLE
I'm expecting line 5, but it's not.
Does anyone know how to solve it?
The text was updated successfully, but these errors were encountered:
Hi, I've been using Template-Toolkit for many years.
I'm having trouble debugging when using OUTLINE mode.
I can't get the correct line number in debug mode.
example.pl
result
I'm expecting line 5, but it's not.
Does anyone know how to solve it?
The text was updated successfully, but these errors were encountered: