Skip Menu |

This queue is for tickets about the HTML-Template-Compiled CPAN distribution.

Maintainer(s)' notes

Note: there is a bug with caching and TMPL_INCLUDE_VAR since 0.97_004 until 0.98. either use an earlier version or upgrade to 0.98_001. Another workaround is to precompile all templates to file_cache_dir. The bug happens when including a template via INCLUDE_VAR and the template is not yet compiled or has changed.

I'm sorry if the change about aliases came quite unannounced. I didn't expect any problems since dollar signs are not allowed in template vars, but I heard from at least one case where people were doing exactly this.
Please do not use unallowed characters in template vars. Allowed are (from the HTML::Template::FAQ): Numbers, letters, '.', '/', '+', '-' and '_'.
This should work in HTML::Template::Compiled::Classic.
in HTML::Template::Compiled you should be only using numbers, letters and _.
The dot, for example, is special. If you need to get a hash key from the template parameters with special charcaters, you can try <tmpl_var _.$var$name$with$dollars >

There will be a workaround in the next version:
local $HTML::Template::Compiled::Compiler::DISABLE_NEW_ALIAS = 1;


Please report any bug you find.
The code is now hosted on https://github.com/perlpunk/HTML-Template-Compiled
If you have a bug report, you can also post it there in the "Issues" section.
In the bugreport, please include, if possible, the module version, perl version and a testcase that reproduces the error; that makes it easier to find the bug.

The issue with not reloading includes of includes should be fixed in version 0.95_003. If you have any problems though please report!

Using query() and the dot syntax might not work together always. If you have a tmpL_var name="..foo" (going up the stash one level) the var foo is not detected and will not be reported by the query() function. Since the dot syntax is for dereferencing hashes and method calls the query function might not make sense anyway. I believe it is a bad idea to let the program do things if the template is using a certain variable.

Thanks!

Report information
The Basics
Id: 28094
Status: resolved
Priority: 0/
Queue: HTML-Template-Compiled

People
Owner: Nobody in particular
Requestors: henrik [...] adapt.dk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.87



Subject: Differences in what HTML::Template and HTC accepts as param-name
HTML::Template::Compiled is more strict in what is accepts as PARAM_NAME than HTML::Template is. Is seems that the equal sign is not permitted. We use PARAMS of the form '<param>==<value>' set in the perl-code as a poor mans substitute for expressions - not too nice but it works. Seee the following: [henrik@clover henrik]$ perl -MHTML::Template -MHTML::Template::Compiled -de 1 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 1 DB<1> $t=HTML::Template::Compiled->new(filename=>'test.tmpl'); HTML::Template::Compiled::Parser : Syntax error in <TMPL_*> tag at test.tmpl :1 near 'test==2...' DB<2> $t=HTML::Template->new(filename=>'test.tmpl'); DB<3> q [henrik@clover henrik]$ cat test.tmpl <TMPL_VAR name="test==2"> [henrik@clover henrik]$
On Mi. 11. Jul. 2007, 06:40:05, HTOUG wrote: Show quoted text
> HTML::Template::Compiled is more strict in what is accepts as
PARAM_NAME Show quoted text
> than HTML::Template is. > > Is seems that the equal sign is not permitted. > > We use PARAMS of the form '<param>==<value>' set in the perl-code as
a Show quoted text
> poor mans substitute for expressions - not too nice but it works.
interesting, thanks for the report. i implemented HTML::Template::Compiled according the documentation for HTML::Template. in http://search.cpan.org/~samtregar/HTML-Template-2.9/ Template.pm#FREQUENTLY_ASKED_QUESTIONS it says: Show quoted text
> Q: What characters are allowed in TMPL_* NAMEs?
Show quoted text
> A: Numbers, letters, '.', '/', '+', '-' and '_'.
so equal signs shouldn't be possible. so my question is, should i implement it anyway? i should then probably report a documentation bug for HTML::Template. actually, there are even more signs that work but shouldn't.
We would like it to accept '=' (equal sign) and ':' colon. Others can have different opinions. Could it be an option - perhaps an argument to HTML::Template::Compiled->new where the permitted set of characters are defined (perhaps just the extensions to the normal set). That should be able to satisfy everybody.
version 0.87 will accept all characters (except of course ' or ") as TMPL_* NAMEs, like HTML::Template does.