-1

I would like to use Getopt::ArgParse, as it provides a more userfriendly interface then Getopt::Long. Now the problem is that Getopt::ArgParse requires Moo, which in turn requires a whole bunch of packages that are not included in the standard CentOS repositories. As per customer policy I am kind of limited in what I can install ... so I was wondering if there is an argparse style package that does not require Moo or Moose.

EDIT I am giving Getopt::Lazy a try

EDIT 2 Getopt::Lazy seems to be really outdated - here is my attempt at using it.

EDIT 3 I was hoping to find something as usable and dependencyless as pythons argparse - its included in the standard library now, and in older versions it just requires one file ... after fiddling around with various modules I ended up using plain old Getopt::Long.

Community
  • 1
  • 1
Isaac
  • 810
  • 2
  • 13
  • 31
  • Have you checked https://metacpan.org/pod/MooseX::Getopt ? – simbabque Oct 09 '15 at 08:25
  • [Moose](http://p3rl.org/Moose) has even more dependencies than [Moo](http://p3rl.org/Moo). – choroba Oct 09 '15 at 08:25
  • @choroba true, I did not realize that I have the epel repo enabled ... I will update my question. – Isaac Oct 09 '15 at 08:34
  • @Isaac Could you install modules in the application directory? Also, what do you like about Getopt::ArgParse so we can make a better recommendation for a replacement. – Schwern Oct 09 '15 at 09:30
  • 2
    You can get a pretty up to date version of Moo for Centos from my CPAN/RPM repository at http://rpm.mag-sol.com/. – Dave Cross Oct 09 '15 at 09:40

1 Answers1

4

A quick look at Getopt modules with minimal dependencies shows...

However, you're going to find working in Perl to be really cramped if you can't install CPAN modules. You'll waste a lot of your client's time and money reinventing wheels, or using inferior ones.

Rather than depending on CentOS packages, you can install Perl modules yourself and put them in the project you're developing. As far as your customer is concerned it's just project code. Simplest way to accomplish this is using local::lib and cpanm. You can completely break your dependency on the system Perl and install your own version of perl with perlbrew.

Schwern
  • 153,029
  • 25
  • 195
  • 336