I was going through the solutions to the expert Perl Quiz of the Week when I came across Mark Jason Dominus' commentary regarding the Mail::Box::MH module. To wit, he states:

That sounds like a joke, doesn't it? Say "use Mail::Box::MH" and you load *seventy* modules.

I tend to agree that loading seventy modules seems a little excessive; however, where do we define the cut-off point? The common refrain in most programming circles is to re-use a module rather than write your own. The Mail::Box::MH module obviously adheres to this mantra, since it pulls in seventy helper modules.

As another example, I use the Class::DBI module all the time when doing database work. Class::DBI uses thirty-two modules. For what Class::DBI does, I feel it's a fair trade-off.

As an aside, eight of the required modules are actually part of Class::DBI itself, so we should count that as one module. That still leaves twenty-five other required modules. I also do not consider the base, strict, vars, and warnings modules as problematic since virtually every Perl module will include this modules. Therefore, there are still twenty-one other modules required by Class::DBI.

perl -l -MClass::DBI -e 'print join "\n", keys %INC' | sort | uniq __OUTPUT__ /usr/lib/perl/5.8.2/auto/Storable/autosplit.ix AutoLoader.pm Carp.pm Class/Accessor.pm Class/DBI.pm Class/DBI/Column.pm Class/DBI/ColumnGrouper.pm Class/DBI/Query.pm Class/DBI/Relationship.pm Class/DBI/Relationship/HasA.pm Class/DBI/Relationship/HasMany.pm Class/DBI/Relationship/MightHave.pm Class/Data/Inheritable.pm Class/Trigger.pm Config.pm DBI.pm DynaLoader.pm Exporter.pm Exporter/Heavy.pm Fcntl.pm Ima/DBI.pm List/Util.pm Scalar/Util.pm Storable.pm UNIVERSAL/moniker.pm XSLoader.pm base.pm overload.pm strict.pm vars.pm warnings.pm warnings/register.pm

What do other monks think? How many modules can one module require before it is considered too many? Given the speed of today's computers and the amount of memory they have, is this question academic?


In reply to How Many Modules Is Too Many? by Belgarion

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.