prashantpokhriyal has asked for the wisdom of the Perl Monks concerning the following question:

I want to create a CLI application, which is going to parse user input and then call some third party rest service to get back the result . So is there any package which will make this easy for me?

Replies are listed 'Best First'.
Re: Package for cli application
by choroba (Cardinal) on Oct 03, 2017 at 19:59 UTC
    See App::CLI, or more advanced and still evolving App::Spec. You might want to see Term::ReadKey for the low-level stuff.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      thank you sir. I'll have a look over it

Re: Package for cli application
by stevieb (Canon) on Oct 03, 2017 at 19:57 UTC

    Getopt::Long to handle the application's parameters and user input, and potentially REST::Client to connect to the remote API.

    Without any further details, it's difficult to help much further than a couple of recommendations. Either way, you're likely going to have to integrate more than just a single package to get everything to hang together (again, depending on complexity).

      I want to use same kind of functionality like nodejs cli application has. Or you can say a REPL based application.
Re: Package for cli application
by jahero (Pilgrim) on Oct 04, 2017 at 05:43 UTC

    MooX::Commander for easy integration with one of famous OOP frameworks. Beam::Wire to automate repetitive tasks which share the same logic (code) and differ in input parameters. The last one is actualy a favourite of mine.

    Note that you should perceive these as useful alternatives, there is a LOT of modules that could be used.

    EDIT: added links to CPAN (text previously written on tablet)

Re: Package for cli application
by dmitri (Priest) on Oct 04, 2017 at 19:34 UTC
Re: Package for cli application
by gnosti (Chaplain) on Oct 05, 2017 at 06:09 UTC