You have the wisdom and discipline (and steel-trap memory, apparently :) to make a mistake once and never make it again. I saw long ago that I had not. One of the lessons I drew from that observation was to program defensively. Even when I have absolute control of both code and data, however simple, I find the effort of defensive programming is usually, in the end, repaid.

Defensive programming is all well and good when dealing with data from an unknown or untrusted source. When the data is just four characters you've written yourself; defensive programming is overkill.

It's been observed time and again that one is oneself the person best equipped to lead one down the garden path.

What you've contrived as an example is a novice mistake. It's a good mistake to learn from.

I should have made it clear in my initial comment that it was not intended for you; I think you are well aware of the issues involved. It's hard to contrive an example of a novice mistake that's not... well, contrived, but please be assured that the example in question was directed not to you but to novices.


Give a man a fish:  <%-{-{-{-<


In reply to Re^6: bracket processing by AnomalousMonk
in thread bracket processing by rajaman

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.