I am aware that eval is pretty slow. I am using an array to store the order through which data should be passed between subs. When the path is determined, a number of values will be processed through the subs referenced by this array. What I'd prefer to do is avoid the overhead of iterating through this array and just create a temp sub that processes everything in place. I can easily create something to write this sub. What I was wondering concerns speed. Should I eval the text for the sub or should I write out to a file and require it? Please note that these steps sometimes takes up to half an hour to process in short bursts and then the script is rerun with different parameters to create a new path that the data must use. I cannot generate these paths beforehand as the paths change based upon a number of factors at runtime. I understand that eval vs require shouldn't be my biggest problem but as an academic excercise, which is faster?

antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1


In reply to require vs eval by antirice

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.