Certainly I can give you my opinion why it is not good. (When I said, in my prev post, that you knew it was bad, I was sincere, but unfortunately you thought I had an evil mind...Well)
  1. You asked me why it was bad in *this* case. My answer is simple, it is not just bad in this case, it is bad in all cases, including this one. This is something about principle. It is just like you ask me why "goto" is bad in *this* case, I will say, no, it is bad in every case, you should never ever use it.

    Whatever you archieved here, can be easily archieved by using a hash containing all coderef's (hard ones). What is the point to violate principles, when you can complete the same task by following the principles, and gain more maintainablility and flexibilty?

  2. Modern programming no longer appreciates smart tricks that much, on the contrary, we strongly stress the importance of maintainability more than ever.

    To make your piece of code work, it requires to turn off "use strict". You may argure that we can just turn off use strict refs for that particular lexical scope to reduce the danger, but still someone maintain your code may add some bad code into that lexical scope, and miss the chance of correcting it in the first place, all because "use strict" is turned off.

    To be frank, after couple of months, even you may forget that that piece of code is a mine field. Does this not happen all the time to us?

    A really dangerous thinking in programming is to assume everything will go well by its own. That is never true.

In reply to Re: Re: Re: Naming Subs by pg
in thread Naming Subs by eoin

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.