In the case of Switch.pm, anything other than parsing code exactly the way perl does is unaccaptable, because anything less will cause bugs, often in areas which are unrelated to the use of a switch.
That's like saying you can't make typos when editing, because they cause bugs. And you are implying those bugs can't be found before they product is released. If Switch.pm parses something incorrectly, it's very likely to produce uncompilable code. Perhaps you deliver code without even attempting to compile, I sure don't. In the few cases it doesn't produce uncompilable code, it'll produce code that is wrong - and your test suite is going to catch it. (If it doesn't produce code that's wrong, the code is correct, so it's not a problem). If you don't want to trust your test suite, you can always visually inspect the results of the source filter, to check whether it substituted only the code you wanted to be substituted, and all of it.

The essence is that you write a particular program, and apply a filter to it. And that program isn't going to change from run to run. It's fixed. It's not input. Switch.pm might not parse Perl correctly, but that's ok because you can catch the abnormalities in time.

Abigail


In reply to Re: No braces by Abigail-II
in thread No braces by jacques

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.