<?xml version="1.0" encoding="windows-1252"?>
<node id="475932" title="Re^4: Perl Best Practices" created="2005-07-18 20:24:35" updated="2005-08-13 22:40:03">
<type id="11">
note</type>
<author id="107600">
TheDamian</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;
Exceptions suffer exceptions :), for instance for programs that mustn't die whatever happens
&lt;/i&gt;&lt;/blockquote&gt;

In which case the top level of the program needs to be running inside an &lt;tt&gt;eval{...}&lt;/tt&gt; anyway, to protect it from intrinsic exceptions like divide-by-zero or call-on-missing-method. So exceptions are still okay, as they'll always be caught.

&lt;blockquote&gt;&lt;i&gt;
And concerning the 8th perl coding practice: could you explain it a bit?
&lt;/i&gt;&lt;/blockquote&gt;

Sure, but an adequate explanation is about 30 pages long. Which is why I put it in a &lt;a href="http://www.oreilly.com/catalog/perlbp/"&gt;handy book&lt;/a&gt;, very soon to be available from most good bookstores. ;-)

&lt;p&gt;Briefly, always using &lt;tt&gt;/x&lt;/tt&gt; allows you to set out regexes readably, and to comment them. Always using &lt;tt&gt;/ms&lt;/tt&gt; makes Perl regexes work the way most people expect them to work, and prevents very subtle edge-case errors. Using &lt;tt&gt;\A&lt;/tt&gt; and &lt;tt&gt;\z&lt;/tt&gt; is essential for saying what you mean under &lt;tt&gt;/m&lt;/tt&gt; (which you'll always be using).</field>
<field name="root_node">
475285</field>
<field name="parent_node">
475691</field>
</data>
</node>
