"With Perl, I'd say just write the most understandable and maintainable code you can." I definitely agree with that. Sometimes I see posts that use obscure and unnecessary language features that don't improve the efficiency of the code. Perl is a big language and not every thing that is possible should/needs to be used. The uncommon stuff should be used when it is really needed, not to impress some "new" monk. That is just the wrong way to teach Perl.

Yes, you are quite correct about load instructions. I've written ASM for Intel, DG, DEC, IBM, Motorola, SEL, Zilog and a few other very weird processors. I've even designed the hardware for 2 DSP processors myself. For those there was no ASM language, all code was what is called microcode. That is some hairy stuff to write because there is no O/S and it is possible to code instructions that can actually damage the processor (like say cause a conflict on a bus). If I remember right a load on a DG processor would set the flags, but that is not true on an Intel processor.

I think we both agree that using the Perl language features in a way that describes the algorithm clearly is the best way to go. I'm all for using the full power of the Perl language. I'm not saying that we shouldn't or that the code should be "dumbed down". I just object when the code is unnecessarily complicated. Sometimes it is necessary to be complicated.

We do have the problem where things that I think are simple, others think are complicated. I just wrote a piece of code with "DEBUG and print....", to me that is simple. I used the constant module, use constant DEBUG => 1;. The advantage of this over $DEBUG is supposed to be that Perl will eliminate the "and" if DEBUG => 0;


In reply to Re^6: next unless condition by Marshall
in thread next unless condition by hankcoder

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.