Earlier in the Chatterbox, I asked the following:

<atcroft> Anyone know a good module or tutorial on writing code to have the ability to add functionality using plugins/addons/modules?

There were a few replies mentioning Module::Pluggable, or to look at double dispatch and rolling my own method. So, what are your (insight|opinions|thoughts) on it, or do you have (links|references|specific modules) you can point me to?

(My thanks to LanX, MidLifeXis, and Voronich, for suggesting I post this for response from the larger community.)

Update: 2013-12-30
There have been several comments asking for more detail on what I had in mind. I had wanted to get general feedback, but the (personal) project I have in mind that would use this is a program looking at files dumped into a subdirectory and initially recording a small amount of information, but I wanted a more modular way of adding in additional capabilities for specific file types (for example, have the initial program working, then add in a module for retrieve EXIF information from JPGs in the directory or to process MBOX files at a later date, without having to modify the initial (possibly running) program).


In reply to Recommendations for adding plugin/addon capability to a program by atcroft

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.