Just to respond on your first question. Yes, it is useful to load all of the modules in a directory. As Aristotle mentioned it is nice if you are working on a plugin system. I have seen this used particularly in IRC bots.

You do NOT do require XML::*, but rather you require all of the files in a program specific directory.

Normally once you require all of the modules, you run a setup routine in each file that generates hooks. Then in IRC as an example, when an event occurs all of the associated hooks in your hash are executed.

ex. You ask the bot what time it is. Clock module gets the local time of the requestor. if smart *ss module loaded, generate smart *ss responce if normal module loaded, generate normal responce.

Another nice benifit is you can dynamicly load and unload the modules without having to shutdown the bot. So you can administer the bot remotly.

Zero

In reply to Re: Being helpful to a fault? by Zero_Flop
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.