I'm currently working on a set of scripts for collecting different types of system information from a very heterogeneous network (Linux, BSD, HPUX, AIX, SGI) and building a repository. My current script is HUGE since it has to support the neuonces of all of the operating systems. What I was hoping to do was break it into separate "plug-ins" if you will that will only get loaded/run on specific platforms. I though about putting them in separate packages/namespaces and then manually editing the scripts to include only the specific packages I needed, but in that case I might as well write individual scripts for each type of host. Also, some of the systems have certain aspects that I'd like to collect data on, and others that I don't. Basically I'm looking for anyone that's had experience in writing "pluginable code" or knows of some sample code that I can look at. Any suggestions on a course of action to start working on?

In reply to Writing Plugin-Able perl scripts by Gurft

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.