Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I was looking to write a script that required quite a bit of modularity and separation of generic concerns from the scripts concerns. I have found 3 such frameworks (briefly discussed below) but would be glad to hear of others


CLI::Framework seems to be the most useable of the 3. It has good docs. It comes with two working samples, one simple example and one much more complicated. The complicated example shows how to maintain state in an application and share that state between commands. One issue is that the object-oriented access to that state in the command is via $self->$slot not $self->app->$slot thus potentially creating conflicts between application slots and command slots.


App::Cmd is by the prolific and well known Ricardo Signes. Like CLI::Framework, it support subcommands. It does not come with complete samples. But the nice thing is you can find Ricardo on almost anytime of the day or night. Both App::Cmd and CLI::Framework delegate option processing to Getopt::Long::Descriptive.

One key difference between the two is that you manually map application command names to modules in CLI::Framework. App::Cmd automatically loads all modules under the namespace of your application module.

Why is App::Cmd not quite as good as CLI::Framework

It's scary to pick someone over Ricardo, but the lack of working examples, along with the lack of pre-packaged common commands make CLI::Framework a bit more attractive.

On the other hand, if you have a lot of commands to write and dont like updating a central dispatch table, then the decentralized control and coordination of App::Cmd might be just the ticket for you.


App::Framework is interesting. The one thing it seems to lack is any mechanism for commands. In other words, it aimed to make applications more scaleable, but it has no support for application command (and subcommand) dispatch. Both of the other frameworks have support for subcommands, allowing for options to be specified both for the application as well as the (sub)commands.

But only CLI::Framework provides fully working examples of it.

In reply to scripting frameworks - a cursory glance by metaperl

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    NodeReaper gets another author to use Module::Build

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (9)
    As of 2018-05-22 19:32 GMT
    Find Nodes?
      Voting Booth?