Search code examples
perlcygwincpan

unavailable cpan in cygwin


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

Solution

  • Reinstalling perl helped.

    $ apt-cyg install perl