簡體   English   中英

我通過cpan安裝了一個perl模塊。 但我該如何使用它?

[英]I installed a perl module via cpan. But how do i use it?

在經歷了很多問題后,我設法讓cpancygwin工作。
我做了: cpan[2]> i Log::Log4perl ,它似乎工作。 即它下載了一些東西:

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)  

所以現在我有以下瑣碎的腳本:

#!/usr/bin/perl  

use strict;  
use warnings;  

use Log::Log4perl qw(:easy);  

當我嘗試運行它時,我得到:

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

我搜索了下~/.cpanLog4perl.pm但我不能找到它。 為什么? 沒有cpan安裝嗎? 我還需要做點什么嗎?

cpan i提供有關包裹的信息。

使用cpan install ...來安裝包。

(或輸入幫助幫助...)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM