質問

After lot's of issues I managed to get cpan to work in cygwin.
I did: cpan[2]> i Log::Log4perl and it seemed to work. I.e. it downloaded something:

cpan[2]> i Log::Log4perl  
Fetching with LWP:  
http://cpan.localhost.net.ar/authors/01mailrc.txt.gz  
Going to read '/home/jsmith/.cpan/sources/authors/01mailrc.txt.gz'  
............................................................................DONE  
Fetching with LWP:  
http://cpan.localhost.net.ar/modules/02packages.details.txt.gz  
Going to read '/home/jsmith/.cpan/sources/modules/02packages.details.txt.gz'    
  Database was generated on Mon, 13 May 2013 17:53:03 GMT  
..............  
  New CPAN.pm version (v2.00) available.  
  [Currently running version is v1.960001]  
  You might want to try  
    install CPAN  
    reload cpan  
  to both upgrade CPAN.pm and run the new version without leaving  
  the current session.  


..............................................................DONE  
Fetching with LWP:  
http://cpan.localhost.net.ar/modules/03modlist.data.gz  
Going to read '/home/jsmith/.cpan/sources/modules/03modlist.data.gz'  
............................................................................DONE  
Going to write /home/akis/.cpan/Metadata  
Module id = Log::Log4perl  
    DESCRIPTION  Log4j implementation in Perl  
    CPAN_USERID  MSCHILLI (Michael Schilli <m@perlmeister.com>)  
    CPAN_VERSION 1.41  
    CPAN_FILE    M/MS/MSCHILLI/Log-Log4perl-1.41.tar.gz  
    DSLIP_STATUS ampOp (alpha,mailing-list,perl,object-oriented,Standard-Perl)  
    INST_FILE    (not installed)  

So now I have the following trivial script:

#!/usr/bin/perl  

use strict;  
use warnings;  

use Log::Log4perl qw(:easy);  

When I try to run it I get:

Can't locate Log/Log4perl.pm in @INC

I searched under ~/.cpan for Log4perl.pm but I can not find it. Why? Didn't cpan install it? Do I need to do something else?

役に立ちましたか?

解決

cpan i provides INFORMATION about a package.

Use cpan install ... to INSTALL a package.

(or type help for help...)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top