Regarding your first question, I don't think there is a situation where you would want to, by default, load in every module in a directory. Could you imagine seeing

use XML::*;

in someone's code? Not cool.

I can see the motivation of the original question and how it could occur and why someone might think that it is what they want, and I'm guessing that its related to Object Oriented Perl. Let's say you have a perl class Foo, with subclasses Foo::A, Foo::B, and Foo::C. Now, if you have a script that could have any of those classes returned from a function call you would need to include all those packages. Now, if the function called from your script is changed to also return Foo::D, your script will likely be broken.

On your second question, I typically point to the larger problem if I can see one, and provide some options to solving the larger problem. I won't, however, go into a typical question assuming there is a major flaw in their design. In the case with this question, I'm assuming the layout of their modules, while working fine for their initial design, development, and testing, are turning into a pain when modified. Now, a change in file A is forcing changes in file B. If that is truly the deeper problem, rather than trying to work around use, they should look to placing the classes in question into a single file.


In reply to Re: Being helpful to a fault? by Steve_p
in thread Being helpful to a fault? by graff

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.