That is no great deal since the requiring is done only once. The package holds a lexically scoped hash of anonymous subs keyed on the filename. On a second call of servlet with a specific filename that sub is returned and can be used; the generated whatever.al must not be required twice - except on code change of the source. That is what the timestamp checking is about: if the source file is newer, the file is deleted from %INC and is thus required again. The new sub overwrites the old one. In short, this happens:
package Foo; $f = 'testsub.pl'; $s = eval "require $f"; delete $INC{$f}; $t = eval "require $f"; print "$_\n" for ($s,$t); __END__ CODE(0x8167948) CODE(0x81679a8)
And yes, I have to write a testsuite. (is there a leak?)
And yes, having a synopsis to talk about would be nice.

I'll update the code in the previous post sometime really soon (today or tomorrow).

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

In reply to Re^2: Follow up to RFC: Templating without a System (required) by shmem
in thread Follow up to RFC: Templating without a System by shmem

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.