1. log tired of warnings
Use of uninitialized value
/usr/local/share/perl/5.10.1/Dancer/Template/Ctpp2.pm line 36
2. Error must be checked
see patch
Subject: | Dancer-Template-Ctpp2.patch |
*** lib/Dancer/Template/Ctpp2.pm 2010-04-30 16:52:26.000000000 +0400
--- /usr/local/share/perl/5.10.1/Dancer/Template/Ctpp2.pm 2010-11-21 02:42:25.000000000 +0300
***************
*** 32,39 ****
$ctpp2_cfg{'source_charset'} = $source_charset;
$ctpp2_cfg{'destination_charset'} = $destination_charset;
}
!
! my @inc = ("$_cfg{'include_dir'}");
$_ctpp2 = new HTML::CTPP2(%ctpp2_cfg);
--- 32,40 ----
$ctpp2_cfg{'source_charset'} = $source_charset;
$ctpp2_cfg{'destination_charset'} = $destination_charset;
}
!
! my $cfg_dir = $_cfg{'include_dir'} || '';
! my @inc = ("$cfg_dir");
$_ctpp2 = new HTML::CTPP2(%ctpp2_cfg);
***************
*** 62,72 ****
--- 63,83 ----
# Dancer::Logger->debug("Plain: ".$template);
$b = $_ctpp2->parse_template($template);
}
+
+ my $e = $_ctpp2->get_last_error();
+ if ( $e->{'error_code'} ) {
+ die( "Template parse error:\n" .
+ " file: " . $e->{'template_name'} . " line: " . $e->{'line'} . ", pos: " . $e->{'pos'} . "\n" .
+ " error: ". $e->{'error_str'} . "\n" .
+ " error code: " . $e->{'error_code'}) ;
+ }
$_ctpp2->param($tokens);
+
return $_ctpp2->output($b);
}
+
1;
__END__
***************
*** 100,106 ****
write the default layout appropriately.
Also, currently template filenames should end with .tt; again, future Dancer
! versions may change this requirement.
By default, Dancer configures HTML::CTPP2 engine to parse templates from source code
instead of compiled templates. This can be changed
--- 111,117 ----
write the default layout appropriately.
Also, currently template filenames should end with .tt; again, future Dancer
! ersions may change this requirement.
By default, Dancer configures HTML::CTPP2 engine to parse templates from source code
instead of compiled templates. This can be changed