go ahead... be a heretic | |
PerlMonks |
Who uses case_sensitive =>0 in HTML::Templateby Rhandom (Curate) |
on May 23, 2007 at 18:04 UTC ( [id://617069]=perlquestion: print w/replies, xml ) | Need Help?? |
Rhandom has asked for the wisdom of the Perl Monks concerning the following question:
The title is a loaded question. By default anybody using HTML::Template or HTML::Template::Expr is stuck with case_sensitive => 0. You have to explicitly set case_sensitive => 1 in your ->new method if you don't want your case to be ignored.
This is a "good thing" because it does allow you to do <tmpl_var foo> rather than <TMPL_VAR foo>. I can see that. That isn't really my question. That case_sensitive => 0 also allows you to type <TMPL_VAR FOO> rather than <TMPL_VAR foo>. It actually lets you type your variable names case insensitively. My question is, who out there using HTML::Template depends upon their variable names being accessed case insensitively. I'm really just looking to see if anybody actually does. I sort of doubt it. The output of the discussion won't change anything - HTML::Template is too entrenched to change default behavior. I just don't see case insensitive variable names as being a good thing. If anybody is interested why this came up, I got my first bug for the new version of CGI::Ex::Template (part of CGI::Ex but soon to be split) which does both Template::Toolkit and HTML::Template interfaces. The case_sensitive works fine when using templates through the HTML::Toolkit interface, but causes issues when using HTML::Template templates through the Template::Toolkit interface (unless you explicitly pass case_sensitive => 1 your <TMPL_VAR foo> variables must be lower case). I'm fixing the behavior, but I thought it was interesting.
my @a=qw(random brilliant braindead); print $a[rand(@a)];
Back to
Seekers of Perl Wisdom
|
|