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)];

In reply to Who uses case_sensitive =>0 in HTML::Template by Rhandom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.