> should I add Some::Mod to prerequisites

Since you're using require, this would not effect any installation process. But it'll be a run time error. So if you wish to be "kind" to your users, then yes you should add it. If there is a core feature set you can provide and put any of the commands that will never be loaded into extension modules. And in those, make sure you have full coverage of the modules needed.

As for the first part of your question, if you got something work it, go for it. I will say, the whole time I was reading this I kept thinking App::Cmd. I cast no judgement personally regarding the various ways Perl allows for the dynamic creation of subs. I've used only a fraction in my day, but always enjoy seeing the options laid out. However, I will answer the question with a question: do you really need to allow users to define custom commands in that way? It seems like you're looking for a perl REPL/shell - and I think a few options exist. So your question may come down to - which one to use and how do I want to extend it to provide custom commands.


In reply to Re: dynamic method creation, dispatch table or pseudo methods? by perlfan
in thread dynamic method creation, dispatch table or pseudo methods? by Discipulus

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.