<?xml version="1.0" encoding="windows-1252"?>
<node id="977741" title="Re: suggested module/tools to automatically &quot;tighten&quot; my perl" created="2012-06-21 21:13:55" updated="2012-06-21 21:13:55">
<type id="11">
note</type>
<author id="414875">
snoopy</author>
<data>
<field name="doctext">
Is lazy loading an option?
&lt;p&gt;
I.E. can you replace global &lt;code&gt;use&lt;/code&gt; and &lt;code&gt;require&lt;/code&gt; statements with a lazy loader such as [mod://autouse] or [mod://Class::Autouse].
&lt;p&gt;
Alternatively, can you require modules just in time?

&lt;code&gt;
    # conditional use of require
    if ($heavy_lifting_needed) {
      require BigModule;
      ## BigModule-&gt;import(); # maybe
      BigModule-&gt;do_stuff();
    }
&lt;/code&gt;

This could be of benefit:
&lt;ul&gt;
&lt;li&gt; if your code is organised into discrete modules
&lt;li&gt; only some of them are being used in any particular hit
&lt;li&gt; you're not importing symbols into your namespace
&lt;/ul&gt;
</field>
<field name="root_node">
977725</field>
<field name="parent_node">
977725</field>
</data>
</node>
