I just checked out this node -- it happened to be on top at the Monastery Gates when I logged in. There were many responses that tried to answer the question, and lots of back-and-forth between the "seeker of wisdom" and the various helpful monks.

I was compelled to post a reply (which will fall below most monks' radar -- a "Re^5", responding to the seeker at a deeply embedded point in the dialog), where I basically said: Why would anyone want to "solve" this particular problem?

The OP question was: how do you set up a script to automatically "use" all the modules in a given directory, without having to name each module explicitly in the script?

At the time that I posted my reply there, lots of people had pointed to the "require" pragma rather than "use" -- which is syntacticaly correct (though it's not clear that the OP was able to make it work as intended). But no one besides me had commented or inquired about whether getting this to work would be advantageous, prudent or even sensible.

So, my first "koan" relates to that OP specifically: Is there a situation where you would want a perl script to implicitly/automatically load all modules in a given directory? Imagine that part of the motivation is that, when you add more modules to that directory, you don't have to add more "use ModuleN" statements to the script that is using all those modules. Am I missing something by thinking that this is not never a good idea?

The second is more of a leading question that folks here have probably seen before: When someone asks how to achieve a particular result in order to gain some advantage in their work, and this is likely or certain to create some larger problem, do you just answer the question, or do you point out the larger problem?


In reply to 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.