Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2021-10-20 07:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (79 votes). Check out past polls.

    Notices?