My answer is "it depends". Are the subroutines tightly coupled to your main module or are they more general utility functions that might be useful elsewhere? If the subroutines are valuable/reuseable in their own right, then it might make sense to release them either in a more logical namespace, or even in a separate distribution.

For example, consider Mail::Box. This comes in the distribution "Mail-Box", but the distribution contains modules Mail::Box and Mail::Message (and a host of others). Just because they're part of the same distribution doesn't mean they need to be in a hierarchical namespace if another namespace would make more sense.

As another example, in the course of writing a simulation module, I found myself needing a consistent random number user interface. Rather than creating them as "My::Sim::Random::Uniform", etc., I factored out the random number code into a standalone module, Math::Random::OO, and released it separately. My simulation code (not yet released), will just list that module as a prerequisite. That keeps both modules distinct and reusable by others in a more granular way than if they were one monolithic distribution

So, if your helper is just breaking up your code into more manageable chunks for you, then make it a module in a subdirectory of your distribution. If your module is tightly coupled to your code, but its purpose would be clearer with a separate name, then keep it in your distribution with a more directory structure. If your module implements distinct functionality on its own that your module needs, but that others might find themselves needing, too, then release it as a separate module and just include it as a prerequisite in your main module.

-xdg

Code posted by xdg on PerlMonks is public domain. It has no warranties, express or implied. Posted code may not have been tested. Use at your own risk.


In reply to Re: Separate files for CPAN dist by xdg
in thread Separate files for CPAN dist by jacques

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.