<?xml version="1.0" encoding="windows-1252"?>
<node id="880931" title="Re: eval question" created="2011-01-06 15:17:08" updated="2011-01-06 15:17:08">
<type id="11">
note</type>
<author id="176576">
eyepopslikeamosquito</author>
<data>
<field name="doctext">
&lt;P&gt;
Be aware that most Perl experts discourage the use of string eval. For example:
&lt;ul&gt;
 &lt;li&gt; [merlyn] in [id://405165] states: Do not resort to eval-string if other means are available. You're firing up the compiler (slower than almost any other solution), and exposing yourself to hard to debug and hard to secure practices.
 &lt;li&gt; In this &lt;a href="http://perl.plover.com/qotw/e/solution/001"&gt; quiz of the week&lt;/a&gt; MJD states: A good rule of thumb is that unless what you're trying to do is most clearly described as "compile and run arbitrary Perl code", it's probably a mistake to use 'eval' to do it.
 &lt;li&gt; &lt;a href="http://www.oreilly.com/catalog/perlbp/index.html"&gt;Perl Best Practices&lt;/a&gt;, Chapter 8, has a guideline titled: &lt;I&gt;Avoid string eval&lt;/I&gt;. Conway argues that string eval can be slow; produces run time warnings rather than more desirable compile time warnings; and code that generates other code tends to be harder to maintain.
&lt;/ul&gt;
&lt;/P&gt;
</field>
<field name="root_node">
880918</field>
<field name="parent_node">
880918</field>
</data>
</node>
