note
Somni
<p>
Based on reading the thread you linked, and testing the code, this action-at-a-distance behavior can be avoided simply by using the module first.
</p>
<p>
From what I understand there are three major arguments against base.pm:
<ol>
<li>Hidden errors when a module cannot be found.
<li>Manipulation of fields (ala fields.pm) when it's not needed.
<li>Inability to pass a list to used modules.
</ol>
<p>
Given that there are simple counters:
</p>
<ul>
<li>Use the module prior to passing it to use base. This solves both 1 and 3.
<li>The fields manipulation is conditional, based on whether or not fields have been manipulated prior. If you don't need fields, base.pm won't do anything to them.
</ul>
<p>
So, given all of that, what you're left with is a decision between:
</p>
<code>
use Module;
use base qw(Module);
</code>
<p>
and:
</p>
<code>
use Module;
our @ISA = qw(Module);
</code>
<p>
I can tell you I prefer use base from a readability standpoint alone. It also has the advantage of assigning to @ISA at compile-time, instead of run-time, which can resolve some problems if the modules being used attempt to call class methods immediately. Admittedly, this is extremely rare, however.
</p>
<p>
If you are aware of any other outstanding problems with base.pm, by all means, share them. Otherwise what this boils down to is a simple style issue.
</p>
643366
643383