Another important principle is this: Wherever possible, prefer compile-time errors to run-time errors.
Indeed. Finding errors earlier rather than later is a sound general principle in any programming language: it's listed as general guideline number seven at On Coding Standards and Code Reviews, for example. Though more common in C++, this principle applies to Perl as well - after all, using strict catches many typos at compile time rather than run time. Other Perl examples could be given, such as a hash reference catching an odd number of elements in an anonymous hash at compile time - mentioned here and in "Use a hash of named arguments for any subroutine that has more than three parameters" in Perl Best Practices.

As for who invented the find errors at compile time rather than run time meme, in addition to your citation of Scott Meyers in Effective C++, it's also listed as one of the 101 Guidelines in C++ Coding Standards by Alexandrescu and Sutter (2004), as described in this comparison of C++ Coding Standards with Perl Best Practices.


In reply to Re^6: Summing numbers in a file by eyepopslikeamosquito
in thread Summing numbers in a file by pvfki

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.