0

I have unsuccessfully tried to install Perl module in cygwin like in an answer. I have got the following error:

$ perl -MCPAN -e shell
Can't locate CPAN.pm in @INC (you may need to install the CPAN module) (@INC   contains: /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/site_perl/5.22 /usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/vendor_perl/5.22 /usr/lib/perl5/5.22/x86_64-cygwin-threads /usr/lib/perl5/5.22 .).
BEGIN failed--compilation aborted.

How can I obtain cpan in my cygwin?


There are some additional details. Actually my purpose was to install ack like in answer. However, it didn't work. After installing I have got an error:

$ ack
Can't locate filetest.pm in @INC (you may need to install the filetest module) (@INC contains: /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/site_perl/5.22 /usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/vendor_perl/5.22 /usr/lib/perl5/5.22/x86_64-cygwin-threads /usr/lib/perl5/5.22 .) at /home/loom/bin/ack line 218.
BEGIN failed--compilation aborted at /home/loom/bin/ack line 218.

The following was my trying to locate cpan

$ cpan
-bash: cpan: command not found

$ ll /usr/lib/perl5/5.22/CPAN.pm
ls: cannot access '/usr/lib/perl5/5.22/CPAN.pm': No such file or directory

$ find /usr/ -name *.pm | grep CPAN
/usr/lib/perl5/5.22/CPAN/Meta/Converter.pm
/usr/lib/perl5/5.22/CPAN/Meta/Feature.pm
/usr/lib/perl5/5.22/CPAN/Meta/History.pm
/usr/lib/perl5/5.22/CPAN/Meta/Merge.pm
/usr/lib/perl5/5.22/CPAN/Meta/Prereqs.pm
/usr/lib/perl5/5.22/CPAN/Meta/Requirements.pm
/usr/lib/perl5/5.22/CPAN/Meta/Spec.pm
/usr/lib/perl5/5.22/CPAN/Meta/Validator.pm
/usr/lib/perl5/5.22/CPAN/Meta/YAML.pm
/usr/lib/perl5/5.22/CPAN/Meta.pm
/usr/lib/perl5/5.22/Parse/CPAN/Meta.pm
Community
  • 1
  • 1
Loom
  • 9,768
  • 22
  • 60
  • 112
  • That's odd...the [perl package](https://cygwin.com/packages/x86_64/perl/perl-5.22.3-1) should install CPAN.pm in `/usr/lib/perl5/5.22/CPAN.pm`, which is in your `@INC`. What happens if you do `cpan Foo::Bar` (where Foo::Bar is the module you want to install)? – ThisSuitIsBlackNot Feb 16 '17 at 18:53
  • Thank you @ThisSuitIsBlackNot. I have expanded the question – Loom Feb 16 '17 at 19:24
  • 1
    TSIBN has already answered your question: It comes with the `perl-5.22.3-1` package. So (re)install that package! – ikegami Feb 16 '17 at 19:33
  • @ikegami - Thank you. – Loom Feb 16 '17 at 20:08

1 Answers1

1

Reinstalling perl helped.

$ apt-cyg install perl
ikegami
  • 367,544
  • 15
  • 269
  • 518
Loom
  • 9,768
  • 22
  • 60
  • 112
  • To use `apt-cyg`, you'd first have to [install it](https://stackoverflow.com/questions/45286337/how-to-install-apt-cyg-for-cygwin) as it isn't available in Cygwin normally. – rustyx Sep 10 '21 at 07:54