Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Who uses case_sensitive =>0 in HTML::Template

by Rhandom (Curate)
on May 23, 2007 at 18:04 UTC ( #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)];

Replies are listed 'Best First'.
Re: Who uses case_sensitive =>0 in HTML::Template
by tinita (Parson) on May 24, 2007 at 08:17 UTC
    interesting question - as i'm the author of HTML::Template::Compiled i'm also interested in that. setting case_sensitive to 0 causes a slowdown of 50% for my module.
Re: Who uses case_sensitive =>0 in HTML::Template
by pKai (Priest) on May 24, 2007 at 06:01 UTC
Re: Who uses case_sensitive =>0 in HTML::Template
by mseabrook (Beadle) on May 25, 2007 at 21:03 UTC
    We use 'case_sensitive => 1' here, but only to enforce consistency amongst the programmers.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://617069]
Approved by Fletch
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2021-05-12 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (132 votes). Check out past polls.

    Notices?