• CPAN常见问题集


    想要更详细的关于perl的文档,你应该到这里来看看(www.perl.com)。如果想看perl FAQ,可以到这里来(perlfaq.cpan.org)
    © 1998-2001 Elaine Ashton <hfb@chaos.wustl.edu> 和 Jarkko Hietaniemi <jhi@iki.fi>,版权所有
    © 2002-10-20 吴海燕(兰州大学高性能计算机实验室)译 <wuhy80@gmail.com>


    I. -常见问题

    • 什么是perl
    • 什么是perl6
    • 什么是CPAN
    • CPAN的logo从何而来,以及我可以在我的文档中使用它吗?
    • 什么是PAUSE、
    • CPAN是如何运作的
    • CPAN是如何自动引导到不同服务器上去的

    II. -关于如何取得perl源程序,模块和脚本的问题

    • 从哪里我可以找到当前PERL的源程序?
    • 从哪里我可以找到老的PERL源程序和模块?
    • 我因该如何理解perl的版本号呢?
    • 我因该如何从源文件开始安装perl呢?
    • 从哪儿我可以找到perl的模块呢?
    • 我要如何卸掉已安装的perl模块?
    • 我怎样才能知道我安装了那些模块?
    • What is a bundle and how do I make one for my own use or distribution on CPAN?
    • 我怎样确定某个模块是否可以运行在我的系统上?
    • 我要怎样手工安装一个模块在私人/非标准的目录下呢?
    • 我要如何使用一个安装在私人/非标准的目录下的模块呢?
    • 从哪儿我可以找到最近更新的perl模块?
    • 从那儿我可以找到windows上的模块?
    • 从哪儿我可以找到perl的binaries/package和perl模块的编译包?
    • perl以及CPAN模块是如何授权的?
    • 标准的perl源程序发布版本中包括模块吗?
    • 那些模块是平台相关的?
    • 从哪儿我可以找到perl 脚本?

     


    III.-RIF 〖Reading is Fun-duh-mental】

    • 从哪儿我可以找到perl FAQs呢?
    • 从哪儿我可以找到perl文档?
    • 从哪儿我可以找到perl模块的文档?
    • 从哪儿我可以找到perl DBI/DBD/database 文档?
    • 我要怎样才能找到/加入/创建perl邮件列表?
    • 从哪儿我可以找到perl journals/magazines?
    • 从哪儿我可以找到perl课程/训练/在线教程?
    • 从哪儿我可以找到在CD-ROM上的CPAN?
    • 我要怎样才能找到/加入/组织一个perl用户小组?
    • 从哪儿我可以找到perl的发展史?

    IV.-错误总是会发生,我要如何解决

    • 当我下载一个模块的时候出错了,我该如何去做?
    • 我下载了一个损坏了的模块/脚本/文件,我该如何去做?
    • 我要如何使用Foo::Bar模块,你可以帮忙吗?
    • 当我下载一个模块时一个VRML阅读器打开了然后报错,我该如何去做?
    • 从哪儿我可以找到GDBM_File/DB_File模块?
    • 我使用search.cpan.org时出了点问题,我该联系谁?

    V.-搜索CPAN,CSPAN其他的已有资源

    • 我怎样使用CPAN的搜索引擎?
    • 我要如何去搜索模块/脚本的文档?
    • 我要如何去查找关于perl的东西
    • 我要如何去寻找Ralph Nader?(我们是C-P-A-N,不是C-S-P-A-N!)

    VI. -发布模块,补丁以及如何报告BUG

    • 我要怎样才能发布模块到CPAN上去呢?
    • CPAN上可以发布共享软件或模块以便可以得到一点报酬或其他什么的吗?
    • 我要如何发布脚本到CPAN上去?
    • 我要如何发布文档
    • 我要如何去报告/修复一个在perl/或它的文档中的BUG?
    • 我要如何报告一个在模块/脚本中的BUG?
    • 当某个模块的作者不愿维护时,我要如何去维护该模块呢?
    • 有专门用来处理模块错误报告的站点吗?
    • CPAN上可以下载到关于作者的统计表吗?

    VII.-如何去镜像CPAN

    • 我要如何去镜像CPAN?
    • 如果我要镜像CPAN的话,我需要些什么?
    • 我的系统是windows的,我要如何镜像CPAN呢?
    • 我该镜像哪一个CPAN站点?
    • 我要如何注册我的镜像站点以便它可以被公众访问?

     


    什么是perl

    perl文档中是这样定义的:

    perl是一种高级语言,它是由Larry Wall和其他的几千个人创造出来的,他大量继承了C语言的特性,同时还从sed,awk和UNIX shell中继承了一些特性,还从其他的至少一打的工具和语言中继承了某些特性。perl对文件处理的能力使它非常适合于解决各种任务,建造原型,系统管理,数据库操作,图形编程,网络和WWW编程,这些特性使得他非常受到系统管理员的欢迎,但是其他的例如数学家,生物学家,新闻人员甚至于管理人员都使用perl。可能你也会使用它

    参考:http://www.sysadminmag.com/tpj/whatisperl.htm

    寻找perl资料的两个好的站点是 http://www.perl.comhttp://www.perl.org


    什么是perl6?

    在第二次O'Reilly开放源代码会议上,Larry Wall宣布了对perl6的开发。perl6仍然会继承perl5的特性,当然它会用C++改写,它的另一个名字是Topaz。

    如果你对开发感兴趣,可以到这里来http://www.perl.org/perl6/

    "We're really serious about reinventing everything that needs reinventing." --Larry Wall


    什么是CPAN?

    CPAN是“perl档案智能网络”的意思,其中包括了大量的perl模块,软件和文档。你可以从以下几个地方找到CPAN:http://www.cpan.orghttp://www.perl.com/CPAN/或其他的列在http://www.cpan.org/SITES.htmlhttp://mirror.cpan.org中的镜像站点

    同时请注意,CPAN还是一个PERL的模块名,CPAN.pm是一个用来自动下载和安装perl模块的工具,本文档只有少量的关于CPAN.pm的介绍,如果你想要更多的资料请到这里来http://theoryx5.uwinnipeg.ca/CPAN/perl/CPAN.html


    CPAN的logo从何而来,以及我可以在我的文档中使用它吗?

    CPAN的logo是由J.C.Thorpe应我们的要求而制作的,字母“A”是由三本书组成的。

    我们允许你在以下情况下使用CPAN logo:制作一个链接到CPAN或者你写的讨论CPAN的文章。在其他情况下使用的话,请与我们联系!


    PAUSE是什么?

    PAUSE是“Perl Authors Upload SErver”的意思,它允许注册帐户上传他们的perl文档,模块,脚本到CPAN上去。CPAN和PAUSE经常交叉的使用,但是他们之间是不同的,在CPAN.pm中有关于他们的简单讨论;

    在这里的讨论中他们看起来好像是一样的--但实际上他们不一样。PAUSE是authors/,modules和scripts。而CPAN是PAUSE加上clpa/,doc/,misc/,ports/和src。

    如果你想要发布模块的话,请参考以下文档'How do I contribute modules?'。


    CPAN是如何工作的?

    CPAN是由数百位开发者协同工作,超过175个镜像站点共同提供服务,空间和计算能力而组成的,志愿者帮助保持所有的东西可以使用并且负责更新维护。下面是镜像站点分布图

    当一个发布者通过PAUSE发布了一个模块以后,该模块在一小时内将被镜像到全球的其它镜像站点。CPAN上运行着不同的脚本不停的检查镜像站点是否有用。还有一些人帮助发布者选择模块名字以及命名空间,另外也有一些人专门负责回答问题和收集各种信息发布到cpan@perl.org上去,以供进一步的讨论。


    CPAN中的智能选择是如何工作的?

    CPAN Multiplexer是由Tom Christiansen编写的,他运行在http://www.perl.com/CPAN上,提供可用的镜像服务器的列表并可以自动将你带到距离你最近的站点上去,当然你也可以自己选择站点。他根据域名的尾部来判断和分类站点,例如一个“*.ac.uk”的地址将被归类到.uk下面去,而一个*.com将被直接归类到perl.com下面。


    从哪里我可以找到当前PERL的源程序?

    Perl Mongers有一个"Download Perl"的按钮,如果你感兴趣的话,你可以到这儿来 http://www.pm.org/web_site_frosting.shtml


    从哪里我可以找到老的PERL源程序和模块?

    如果你没有一个十足的理由的话就不要安装老的版本,因为他们或多或少的包含一些bug甚至是安全方面的bug。

    需要安装老版本的理由有:想要支持perl 4程序,再现一个只有在老版本中才有的bug,或者是喜欢研究perl的历史。

    CPAN中没有老的版本,不过你可以从以下站点中找到你想要的东西:


    我该如何理解perl的版本号呢?

    目前perl从v.5.6.0开始它的版本号:

    perl v5.6.0是继上一个5.005版本的最近的一个版本。你可能已经注意到了,现在的版本号已经变了,它的版本号是分为偶数与基数的,偶数版本是稳定版,反之则是开发版,这同linux内核版本号是一样的。例如5.6.*是稳定版,而5.7.*这是开发版本号。

    你可以从perl文档中知道更详细的内容。


    我该如何从源文件开始安装perl呢?

    首先你需要一个C编译器。在下载并解压之后,你要先读一读INSTALL文档(这里有如何安装的详细说明)。当然了,还有一些平台依赖性的文件需要你去看看,如果你的安装平台比较特殊的话!!

    perl可以使用从源文件安装的方法安装到所有支持的平台上去。其中包括所有的UNIX系列以及兼容的(如OS/2,PLAN 9,QNX,Amiga,MPE/iX,OS390,Stratus VOS等等),WINDOWS系统。其中以下几个平台比较特殊

    • MacOS (1)
    • AS/400 (2)
    • Novell Netware (2)

    1。用于运行在MAC上的源文件可以从这儿得到 http://www.cpan.org/ports/mac/

    2。用于AS/400和Novell netware的还没有包括到标准PERL发布版本里面,如果你想要安装的话,请到这几个地方看看:http://www.cpan.org/ports/As400/http://www.cpan.org/ports/netware/以及http://www.cpan.org/src/README

     


    从哪儿我可以找到perl的模块呢?

    基于模块在不停的增加,我们推荐你使用CPAN的搜索引擎,尤其是当你知道你想要什么的时候!!


    我要如何安装PERL模块

    最简单的方法是perl -MCPAN -e 'install Chocolate::Belgian',CPAN.pm文档有详细的如何使用该方法的介绍。如果你不想要让系统过多的控制你的安装或者它根本就不能使用的话,那么你就要看看这篇文章了perlmodinstall,他涵盖了UNIX,WINDOWS和Macintosh这几种主流系统。

    如果你是使用的ActivePerl(WINDOWS平台),那么PPM(Perl Package Manager)也可以起到相当于CPAN.pm模块的作用。

    手工安装一般是

    1. 进入模块目录
    2. make Makefile.PL
    3. make;make test
    4. make install(这一步需要管理员权限,或者你将模块安装到你的个人目录下面)

    我要如何移除已经安装了的模块?

    使用ExtUtils::Installed和ExtUtils::Packlist这两个模块来实现。下面是一个例子,在ExtUtils::Packlist中有更详细的例子,可以参考一下。
    #!/usr/local/bin/perl -w

    use ExtUtils::Packlist;
    use ExtUtils::Installed;

    $ARGV[0] or die "Usage: $0 Module::Name/n";

    my $mod = $ARGV[0];

    my $inst = ExtUtils::Installed->new();

    foreach my $item (sort($inst->files($mod))) {
    print "removing $item/n";
    unlink $item;
    }

    my $packfile = $inst->packlist($mod)->packlist_file();
    print "removing $packfile/n";
    unlink $packfile;


    我怎样才能知道安装了哪些模块在我的机子上呢?

     

    • perldoc perllocal

      每当你安装了一个模块,它就会在一个叫perllocal.pod的文件中添加如下所示的信息。而该文件所在地依赖于你所定义的PATH路径,PATH路径可以使用perl -V显示出来。

      下面是添加在perllocal.pod中的文件

      =head2 Wed May 12 13:42:53 1999: C<Module> L<Data::Dumper>

      =over 4

      =item *

      C<installed into: /usr/local/lib/perl5/5.00503>

      =item *

      C<LINKTYPE: dynamic>

      =item *

      C<VERSION: 2.101>

      =item *

      C<EXE_FILES: >

      =back
       

      每个条目包括模块名字,安装日期和时间,安装到哪儿,链接形式(动态还是静态),版本号以及是否可执行,以及其他相关的一些信息!

    • 使用ExtUtils::Installed模块

      ExtUtils::Installed提供了一个用来寻找已安装模块的标准方法。他从.packlist,一个安装模块时创建的文件中得到所需的信息,另外它还提供将安装文件分类的能力和从".packlist"文件中读取目录信息的能力。

    例子如下:
    #!/usr/local/bin/perl

    use ExtUtils::Installed;
    my $instmod = ExtUtils::Installed->new();
    foreach my $module ($instmod->modules()) {


    my $version = $instmod->version($module) || "???";
     

    print "$module -- $version/n";
    }
     

    运行后输出内容如下:


    Apache::DBI -- 0.87
    Apache::DBILogConfig -- 0.01
    Apache::DBILogger -- 0.93
    AppConfig -- 1.52
    Archive::Tar -- 0.22
    BerkeleyDB -- 0.06
    CGI -- 2.74
    CPAN -- 1.59
    CPAN::WAIT -- 0.27
    Catalog -- 1.00
    Compress::Zlib -- 1.11
    Config::IniFiles -- 2.14
    Convert::BER -- 1.26
    Coy -- ???
    Crypt::Rot13 -- 0.04
    Crypt::SSLeay -- 0.16
    DBI -- 1.14
    [.....]
     

    • ActivePerl使用PPM工具包,方法如下;

      C:/>ppm query
      Archive-Tar [0.072 ] module for manipulation of tar archives.
      Compress-Zlib [1.03 ] Interface to zlib compression library
      DBI [1.13 ] Database independent interface for Perl
      GD [1.25 ] Interface to Gd Graphics Library
      HTML-Parser [2.23 ] SGML parser class
      MIME-Base64 [2.11 ] Encoding and decoding of base64 strings
      PPM [1.1.4 ] Perl Package Manager: locate, install, upgrade software
       

       

    • pmtools工具包是由Tom Christiansen写了用来浏览和管理模块的工具,可以从这儿的到它http://language.perl.com/misc/pmtools-1.00.tar.gz ,它的一部分帮助文档:

      pmtools --一套用来帮助管理模块的小程序。里面的每一个程序都只做一件事情,其中包括一下小程序

      • pmpath - 显示模块的绝对路径
      • pmvers - 显示模块版本号
      • pmdesc - 得到关于模块的概述
      • pmall  - 显示所有已安装模块的pmdesc描述
      • pmdirs - 分行显示perl模块的路径
      • plxload - 显示程序运行时加载了什么文件
      • pmload - 显示模个模块编译时加载了什么文件
      • pmexp - 显示模块的接口
      • pminst - 查找安装了哪些模块
      • pmeth - 列出一个类的所有方法
      • pmls - 详细列出模块路径
      • pmcat - 显示模块源码
      • pman - 显示模块的pod文档
      • pmfunc - 显示一个模块中函数的源码
      • podgrep - 在pod文档中查找
      • pfcat - show pods from perlfunc
      • podtoc - list table of contents of a podpage
      • podpath - 显示pod文件的绝对路径
      • pods - 列出所有标准pod以及模块pod
      • sitepods - list only pods in site_perl directories
      • basepods - list only normal "man-page" style pods
      • faqpods - list only faq pods
      • modpods - all module pods, including site_perl ones
      • stdpods - list standard pods, not site_perl ones

    什么是"bundle",我要如何制作一个"bundle"或我要如何使用从CPAN上获得的"bundle"呢?

    第三版的"Programming Perl"将"bundle"定义为“一组在CPAN上的相关联的模块”,这个定义十分明确但它没有告诉你如何去制作一个“bundle”。一个"bundle"可以是任何一组的模块,可以相关也可以不相关。"bundle"是给CPAN.pm用来快速的安装一组模块的。

    一个"bundle"就是一个位于Bundle::名字空间的模块,但她与其他模块不一样,他里面没有一个模块用来安装,只有一个列表列出需要安装的模块。有不少的现成的"bundle"你可以去参考,然后你可以自己依样做出一个来。

    你可以从search.cpan.org得到一个"bundle"的列表,如果你在CPAN.pm下面敲入‘b’的话,也可以得到一个当前允许的"bundle"列表。
    如下;

    cpan> b
    Bundle Bundle::ABH (A/AB/ABH/Bundle-ABH-1.04.tar.gz)
    Bundle Bundle::AO::Base (I/IX/IX/AO-0.32.tar.gz)
    Bundle Bundle::AO::Standard (I/IX/IX/AO-0.32.tar.gz)
    Bundle Bundle::Apache (D/DO/DOUGM/mod_perl-1.25.tar.gz)
    Bundle Bundle::Apache::ASP (C/CH/CHAMAS/Apache-ASP-2.09.tar.gz)
    Bundle Bundle::Apache::Roaming (J/JW/JWIED/Apache-Roaming-0.1003.tar.gz)
    Bundle Bundle::BioPerl (C/CR/CRAFFI/Bundle-BioPerl-1.00.tar.gz)
    Bundle Bundle::Bonsai (Z/ZL/ZLIPTON/Bundle-Bonsai-0.02.tar.gz)
    [....]
     

    如果你在'b'后面加上模块参数,它可以列出关于这个模块的详细信息。

    cpan> b Bundle::DBI
    Bundle id = Bundle::DBI
    CPAN_USERID TIMB (Tim Bunce )
    CPAN_VERSION 1.03
    CPAN_FILE T/TI/TIMB/DBI-1.15.tar.gz
    MANPAGE Bundle::DBI - A bundle to install DBI and required modules.
    CONTAINS Storable Net::Daemon RPC::PlServer Getopt::Long DBI
    INST_FILE /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Bundle/DBI.pm
    INST_VERSION 1.03

    制作一个"bundle"需要以下两步;

    1. 使用CPAN.pm的自动生成"bundle"功能
      如果你没有使用参数的运行"autobundle"的话,它就会自动的将所有系统上的系统打包制作一个系统级的"bundle",如果你只是想要加入一部分模块到"bundle"里面的话,只需要给出想要加入的模块列表,如下:

       

      foo@bar /home/chaos/monkey> perl -MCPAN -eshell

      cpan> autobundle CGI Crypt::Rot13 Date::Christmas Date::Manip

      Going to read /home/chaos/monkey/.cpan/sources/authors/01mailrc.txt.gz
      CPAN: Compress::Zlib loaded ok
      Going to read /home/chaos/monkey/.cpan/sources/modules/02packages.details.txt.gz
      Going to read /home/chaos/monkey/.cpan/sources/modules/03modlist.data.gz

      Package namespace installed latest in CPAN file
      CGI 2.74 2.753 L/LD/LDS/CGI.pm-2.753.tar.gz
      Crypt::Rot13 0.04 0.04 A/AY/AYRNIEU/Crypt-Rot13-0.04.tar.gz
      Date::Christmas 1.01 1.02 H/HF/HFB/Date-Christmas-1.02.tar.gz
      Date::Manip 5.39 5.39 S/SB/SBECK/DateManip-5.39.tar.gz

      Wrote bundle file
      /home/chaos/monkey/.cpan/Bundle/Snapshot_2001_05_09_01.pm


      "Snapshot_2001_05_09_01.pm"这个文件就可以用来安装了,如下
      perl -MCPAN -e 'install Bundle::Snapshot_2001_05_09_01'
      如果找不到snapshot的话,请检查你的CPAN.pm配置是否正确。

      接下来就要将配置文件输出了,如下:
      cpan> o conf cpan_home
      cpan_home /home/chaos/monkey/.cpan

      如果你是系统管理员或者你想要将你想要发布你的模块到大量的机器上面去的话,那么你就会知道这个小工具是多么的棒,如果你有兴趣的话,还可以研究一下它。

    2. 制作发布到CPAN上去的"bundle"版本
    • "bundle"制作先创建一个框架,像这个样子:
      foo@bar /home/chaos/monkey> h2xs -AXcfn Bundle::MyBundle
      Writing Bundle/MyBundle/MyBundle.pm
      Writing Bundle/MyBundle/Makefile.PL
      Writing Bundle/MyBundle/test.pl
      Writing Bundle/MyBundle/Changes
      Writing Bundle/MyBundle/MANIFEST
    • 然后编辑MyBundle.pm文件
      • 删除所有在模块中的申明,版本号
      • 编辑名字并添加'-descriptive info'在名字中
      • 添加C<perl -MCPAN -e 'install Bundle::MyBundle'>到synopsis中去。
      • 添加"=head1 CONTENTS",在他下面加入所有包括在"bundle"中的模块。
        ModuleName [ optional version ] [ - comment or description ]
        其中在comment前面的'-'是必须的。
      • 添加总体概述
      • 添加作者和版权信息

        具体例子如下:

        package Bundle::MyBundle;

        $VERSION = '0.01';

        1;
        __END__

        =head1 NAME

        Bundle::MyBundle - Bundle of my very favourite modules

        =head1 SYNOPSIS

        C<perl -MCPAN -e 'install Bundle::MyBundle'>

        =head1 CONTENTS

        CGI 2.74 - CGI is groovy baby
        Crypt::Rot13 - This would make for some interesting web pages
        Date::Christmas - defies description
        Date::Manip

        =head1 DESCRIPTION

        These modules rock, especially when installed together!

        =head1 AUTHOR

        Ima Bundle ima@bundle.com

        =head1 LINCENSE

        Steal this code!

        =head1 SEE ALSO

        perl(1).

        =cut

         

         

      • 移除目录中所有不再需要的文件,例如'Changes'和'test.pl' ,添加一个README文件,写入一些简短的描述,加入"bundle"中所包括的模块名称。更新MANIFEST文件使它与"bundle"中所包含的文件相吻合
      • 使用'perl Makefile.pl'然后'make dist’,那么Bundle-MyBundle-0.01.tar.gz就构造好了。如下:

         

        foo@bar monkey/Bundle/MyBundle> perl Makefile.PL

        Checking if your kit is complete...
        Looks good
        Writing Makefile for Bundle::MyBundle

        foo@bar monkey/Bundle/MyBundle> make dist
        rm -rf Bundle-MyBundle-0.01
        /usr/bin/perl -I/usr/local/lib/perl5/5.00503/sun4-solaris -I/usr/local/lib/perl5/5.00503 /
        -MExtUtils::Manifest=manicopy,maniread -e "manicopy(maniread(),'Bundle-MyBundle-0.01', 'best');"
        mkdir Bundle-MyBundle-0.01
        tar cvf Bundle-MyBundle-0.01.tar Bundle-MyBundle-0.01
        a Bundle-MyBundle-0.01/ 0K
        a Bundle-MyBundle-0.01/Makefile.PL 1K
        a Bundle-MyBundle-0.01/MyBundle.pm 1K
        a Bundle-MyBundle-0.01/README 1K
        a Bundle-MyBundle-0.01/MANIFEST 1K
        rm -rf Bundle-MyBundle-0.01
        gzip --best Bundle-MyBundle-0.01.tar
         

        以上就是所有的工作了,好好利用它你回受益无穷。


    我如何知道某个模块是否可以安装在我的系统上

    http://testers.cpan.org上查看那些模块可以安装哪些系统上,哪些又不能安装!!

    CPAN testers是由Graham Barr和Chris Nandor发起的测试所有的CPAN上的模块在各个平台上是否可用的一个组织,从那上面你可以得到很详细的关于某个模块在某个平台上是否可用的信息,你可以从它的主页上得到详细的信息!!同时如果你愿意为了perl尽一份力的话,你也可以加入进来!


    我要如何手工安装模块到非标准的目录中去呢?

    首先你需要在运行Makefile.PL时制定安装的prefix和lib。lib是将模块文件安装的地方而prefix则是其他文件的安装地。例如

    yifeng@lab1213$ perl Makefile.PL LIB=/home/yifeng/mylib PREFIX=/home/yifeng/mylib

    其他相关的资料请参考ExtUtils::MakeMaker文档。


    我要如何使用一个安装在非标准目录下面的模块?

    这儿有以下几种方法可以使用:

    • yifeng@lab1213 $ setenv PERL5LIB /path/to/module 来设置环境变量PERL5LIB。
    • 在每个使用那些模块的头部加上 use lib qw(/path/to/module);
    • yifeng@lab1213 $ perl -I/path/to/module 这个是在编译时使用的方法。

    所有的这些方法都会添加/path/to/module到@INC这个环境变量当中去。同时请记住,使用非标准目录的话对程序的可移植性有影响。


    我要如何才能找到最近上传的模块呢?

    这里每天都有如此多的模块上传上来以至于很难完全的跟上模块的更新,不过还是有以下几种方法可以使用的

    这三个站点可以让你每天查看最新的上传模块。


    我在哪儿可以发现用于Windows的模块呢?

    http://aspn.activestate.com/ASPN/Products/ActivePerl-5.6/faq/ActivePerl-faq2.html 有一个关于它的包管理器的FAQ,http://www.northbound-train.com/perlwin32.html也有一系列包括模块在内的可以用于windows的资源。


    从哪儿我可以得到perl的二进制包或者perl模块的二进制包呢?

    http://www.cpan.org/ports/index.html有目前我们知道的所有可用的二进制包。如果你有基于某个平台的二进制包,请发给我们URL。我们不做任何可用的保证,也不会将他们放到CPAN上来因为我们的空间有限。

    perl模块的用于ActivePerl的二进制包可以从这里得到http://www.activestate.com/PPMPackages/.


    perl以及CPAN是如何授权的?

    绝大多数(不是全部)在CPAN上的模块是基于GPL授权的或者作者自己会在模块当中声明。如果版权没有在模块中声明,你可以写信给模块作者以便弄清楚版权问题。

    Open Source组织有一个官方的版权声明,你可以在这儿找到:http://www.opensource.org/licenses/index.html.

    CPAN和PAUSE并不拥有任何的版权,我们强烈要求作者在模块中声明版权问题,如果你需要版权方面的帮助,我们建议你寻找相关的律师

    一般版权应该声明在模块根目录下面的'README'文件中,如下:

    Perl Kit, Version 5.0

    Copyright 1989-1999, Larry Wall
    All rights reserved.

    This program is free software; you can redistribute it and/or modify
    it under the terms of either:

    a) the GNU General Public License as published by the Free
    Software Foundation; either version 1, or (at your option) any
    later version, or
    b) the "Artistic License" which comes with this Kit.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
    the GNU General Public License or the Artistic License for more details.

    You should have received a copy of the Artistic License with this
    Kit, in the file named "Artistic". If not, I'll be glad to provide one.

    You should also have received a copy of the GNU General Public License
    along with this program in the file named "Copying". If not, write to the
    Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307, USA or visit their web page on the internet at
    http://www.gnu.org/copyleft/gpl.html.

    For those of you that choose to use the GNU General Public License,
    my interpretation of the GNU General Public License is that no Perl
    script falls under the terms of the GPL unless you explicitly put
    said script under the terms of the GPL yourself. Furthermore, any
    object code linked with perl does not automatically fall under the
    terms of the GPL, provided such object code only adds definitions
    of subroutines and variables, and does not otherwise impair the
    resulting interpreter from executing any standard Perl script. I
    consider linking in C subroutines in this manner to be the moral
    equivalent of defining subroutines in the Perl language itself. You
    may sell such an object file as proprietary provided that you provide
    or offer to provide the Perl source, as specified by the GNU General
    Public License. (This is merely an alternate way of specifying input
    to the program.) You may also sell a binary produced by the dumping of
    a running Perl script that belongs to you, provided that you provide or
    offer to provide the Perl source as specified by the GPL. (The
    fact that a Perl interpreter and your code are in the same binary file
    is, in this case, a form of mere aggregation.) This is my interpretation
    of the GPL. If you still have concerns or difficulties understanding
    my intent, feel free to contact me. Of course, the Artistic License
    spells all this out for your protection, so you may prefer to use that.
     


    编准perl源文件中包括模块吗?

    当然了,perl发布版本中包括一系列有用的模块,并且他们可以从perlmodlib文件中找到


    有哪些模块是平台相关的?

    一些平台相关的perl模块已经"bundle"了许多平台相关的模块,其他的你可以从下面找到(下面的太多,也没有什么用,我就不翻译了)

    IBM OS/2

    The following modules come with standard Perl.

    OS2::DLL
    Access to DLLs with REXX calling convention and REXX runtime.
    OS2::ExtAttr
    Access to extended attributes.
    OS2::PrfDB
    Access to the OS/2 setting database.
    OS2::Process
    Constants for /tool{system}(2) call on OS/2.
    OS2::REXX
    Access to DLLs with REXX calling convention and REXX runtime.

    DEC (Open)VMS

    The following modules come with standard Perl.

    VMS::DCLsym
    Perl extension to manipulate DCL symbols.
    VMS::Filespec
    Converts between VMS and Unix file specification syntax.
    VMS::Stdio
    Standard I/O functions via VMS extensions.
    VMS::XSSymSet
    Keeps sets of symbol names palatable to the VMS linker.

    Microsoft Windows (32 bit)

    The following modules come with ActiveState Perl.

    Win32::ChangeNotify
    Monitors events related to files and directories.
    Win32::Console
    Uses Win32 Console and Character Mode Functions.
    Win32::Event
    Uses Win32 event objects.
    Win32::EventLog
    Processes Win32 Event Logs.
    Win32::File
    Manages file attributes.
    Win32::FileSecurity
    Manages FileSecurity Discretionary Access Control Lists.
    Win32::IPC
    Loads base class for Win32 synchronization objects.
    Win32::Internet
    Accesses WININET.DLL functions.
    Win32::Mutex
    Uses Win32 mutex objects.
    Win32::NetAdmin
    Manages network groups and users.
    Win32::NetResource
    Manages network resources.
    Win32::ODBC
    Uses ODBC Extension for Win32.
    Win32::OLE
    Uses OLE Automation extensions.
    Win32::OLE::Const
    Extracts constant definitions from TypeLib.
    Win32::OLE::Enum
    Uses OLE Automation Collection Objects.
    Win32::OLE::NLS
    Uses OLE National Language Support.
    Win32::OLE::Variant
    Creates and modifies OLE VARIANT variables.
    Win32::PerfLib
    Accesses the Windows NT Performance Counter.
    Win32::Process
    Creates and manipulates processes.
    Win32::Semaphore
    Uses Win32 semaphore objects.
    Win32::Service
    Manages system services.
    Win32::Sound
    Plays with Windows sounds.
    Win32::TieRegistry
    Mungs the registry.
    Win32API::File
    Accesses low-level Win32 system API calls for files and directories.
    Win32API::Net
    Manages Windows NT LanManager accounts.
    Win32API::Registry
    Accesses low-level Win32 system API calls from WINREG.H.

    从哪儿我可以找到perl脚本呢?


    从哪儿我可以得到perl FAQ?

    perl FAQ是包括在perl发行版本里面的,你可以使用"perldoc perlfaq"得到,当然你也可以到这儿来看看http://perlfaq.cpan.org/


    从哪儿我可以得到perl的文档呢?


    从哪儿我可以找到perl模块的文档


    我从哪儿可以找到perl的 DBI/DBD/database文档?


    从哪儿我可以找perl的邮件列表?

    这儿有几个perl的邮件列表,你可以看看:

    大多数的邮件列表都是公开的,你可以加入。如果你没有发现感兴趣的邮件列表而想要创建一个的话,你可以写信给lists@perl.org区要求建立一个邮件列表。


    从哪儿我可以找到关于perl的杂志呢?


    从哪儿我可以找到关于perl培训/学习的资料?

    培训

     

    在线教程


    我如何才能找到并加入一个perl用户小组?

    perl用户小组又被称为"Perl Mongers",现在在世界各地都有活跃的perl小组。你可以在http://www.pm.org/groups.shtml加入一个小组。或者你也可以在这里http://www.pm.org/start.shtml创建一个


    我从哪儿可以找到perl的老版本和perl的发展历史?

    一个关于perl的老版本发布史的资料可以从这两个地方找到,一是perldoc perlhist,二是从这里http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlhist.html找到。

    更多更详细的关于perl历史的资料可以从这里找到http://history.perl.org/


    当我下载模块时出现问题,我该怎么办?

    当你遇到问题想要联系我们时请先查看以下各个问题,我们每天都检查各个镜像站点以保证他们可用,但还是会有各种各样的问题会发生,请确保你查看了以下问题:

    • 你用什么工具下载?
      web浏览器?
      ftp工具?
    • 你是使用的哪一个服务器?
      请注意:对大多数的请求,我们的智能导航仪都将会把你带到离你最近的服务器上,如果你是使用的web浏览器的话,请注意查看一下URL地址。

      你也可以先回到http://www.perl.com/CPAN上然后选择一个镜像站点,以后你就会默认的被指向到该站点,如果想要改变的话,也请到http://www.perl.com/CPAN上去。
    • 具体的出错信息!
      我们需要你的详细的出错信息,请将它们发送给我们(如果可能的话)
    • 你重新试过了吗?
      服务器可能当时正忙,你可能稍后重试的时候就好了!!

    我下载了的模块/脚本/文件有问题,该怎么办?

    许多的CPAN上的文件以.tar.gz结尾,但不幸的是有一些程序会改变他们的名字(例如:把他们改成_tar.tar),因此你的解压缩没有办法识别并且解开它,你可以试试将后缀名改为.tgz或者换一个浏览器,看看是否可以。如果可以的话,你可以使用FTP下载,绝大多数的站点都是支持FTP下载的,你可以从这里找到镜像站点的列表 http://www.cpan.org/SITES.htmlhttp://mirror.cpan.org/

    如果你是用FTP下载的话,请打开BINARY模式,不要使用TEXT模式。

    如果你对如何正确的解开包有疑问的话,你可以到这里看看http://www.cpan.org/ENDINGS

    如果还是有问题的话,你可以试试换一个服务器下载,如果还是不行的话,请写信给我们,同时请附上文件名以及路径和服务器名。


    我要如何使用Foo::Bar这个模块,可以帮帮我吗?

    对不起,我们不提供这样的服务,只有与CPAN相关的问题我们才给予解答。我们也不会替你查看你的程序代码。

    如果你有什么这方面的问题的话,请先查看帮助文档,如果还不行的话,请到comp.lang.per.modules上去寻求帮助。


    When downloading a module a strange VRML viewer started up and I got an error, what should I do?

    You saw an error window "VRML Console" saying "Compilation error: Unrecognized header string". The reason the VRML viewer starts is that there is a type of compressed VRML file with a .gz extension, using (theoretically) the standard gzip compression. The VRML folk used .gz as a means of cutting down the download time on the old wrl files. Most VRML browsers come with a mini gunzip program. See also the VRML FAQ which also covers this problem.

    You can fix this with the following steps;

    1. Open "My Computer" or Windows NT Explorer.
    2. Select the "View" menu.
    3. Select "Options".
    4. Click the "File Types" tab.
    5. Scroll through the "Registered file types" until you reach "WorldView VRMLViewer Object" and select it.
    6. Click "Remove".
    7. Answer "Yes". (I've never seen these VRML files WorldView claims to be caring about: if you have and you do care, please tell me how to make WorldView stop caring about the .gz and application/x-gzip)
    8. Quit and restart your browser for the change to take effect.
    9. The next time you try open a file ending in .gz Windows will ask you which application to use to open that file. Scroll down to WinZiP (winzip32), and remember to check the box asking whether to always use this application to open this type of file unless, of course, you plan on regularly using the VRML viewer.

    我从哪里可以找到GDBM_FILE/DB_FILE模块呢?

    GDBM_FILE是随着标准PERL 5而发布的。

    你所遇到的问题可能是因为你的系统上没有LIBGDBM或GNU DBM这个库文件,GDBM_FILE依赖于这些文件,这个和你的perl是没有什么关系的,你可以从这里得到帮助 http://www.gnu.org/

    如果你在找DB_FILE的话,他也需要这个叫libdb的库文件,你可以从发布该库文件的地方得到帮助http://www.sleepycat.com/


    如果我使用search.cpan.org时有问题,我该联系谁呢?

    如果你使用search.cpan.org时因为网络或服务器而不能正常使用的话,请联系webmaster@search.cpan.org


    How do I search for anything on CPAN?

    By using a CPAN search engine.

     


    How do I search for module/script documentation? (also known as "How do I use ..."?)

    In general modules and scripts come with their own documentation which should have been installed along with your module/script. (Thanks to Perl's pod-style documentation, "it is very hard to misplace your documentation".)

     


    我可以从哪儿查找资料(不仅仅是perl的)?


    我从哪里可以找到Ralph Nader?

    找错地方了,你应该到这里来看看 http://www.cspan.org/


    我要如何上传模块到CPAN上去?

    如果你愿意学习PAUSE并且你也愿意发布你的模块的话,请参考PAUSE FAQ(http://www.cpan.org/modules/04pause.html),这篇文章会告诉你如何得到PAUSE ID以及如何上传你的模块。另外你还可以参考perldoc perlmodlib和perldoc perlmod这两个文档。


    CPAN上允许上传共享软件或者其他的收费软件吗?

    否。所有的在CPAN上的东西都是免费的。之所以这样的原因是因为CPAN是由成百上千的人们付出时间和其他资源而建立起来的perl社区,如果你想要发布共享软件请到其他的地方去!!!


    我如何才可以上传我的脚本到CPAN上去?

    CPAN有一个脚本的收集地点http://www.cpan.org/scripts/,而如果你想要上传脚本的话, http://www.cpan.org/scripts/submitting.html也会给你很多帮助的!!


    我要如何在CPAN上发布文档?

    如果你的文档是基于某个模块的,请将文档发送给作者。而如果是通用文档的话,请发到Perl5Porters邮件列表上!!


    How do I report/fix a bug in Perl and/or its documentation?

    Always remember to make your bug reports as detailed as possible. "Perl doesn't work." is not a bug report.

    Please note that problems concerning modules that are installed separately from the Perl distribution (such as Tk) are reported differently.

    Here is a checklist from perlbug, a bug reporting tool included in your Perl distribution. It is a bit on the long side, but please read it carefully as the better your bug report is, the more likely the issue will be addressed.

    • What version of Perl you are running?

      Try perl -v at the command line to find out.

    • Are you running the latest released version of perl?

      Look at http://www.perl.com/ to find out. If it is not the latest released version, get that one and see whether your bug has been fixed. Note that bug reports about old versions of Perl, especially those prior to the 5.0 release, are less likely to be incorporated into the source as Perl1 through Perl4 are largely unmaintained.

    • Are you sure what you have is a bug?

      A significant number of the bug reports we get turn out to be documented features in Perl. Make sure the behavior you are witnessing doesn't fall under that category, by glancing through the documentation that comes with Perl (we'll admit this is no small task, given the sheer volume of it all, but at least have a look at the sections that seem relevant).

      Be aware of the familiar traps that perl programmers of various hues fall into. See the perltrap documentation.

      Check in perldiag to see what any Perl error message(s) mean. If message isn't in perldiag, it probably isn't generated by Perl. Consult your operating system documentation instead.

      If you are on a non-UNIX platform check also perlport documentation, some features may not be implemented or work differently.

      Try to study the problem under the Perl debugger,if necessary. See the perldebug documentation.

    • Do you have a proper test case?

      The easier it is to reproduce your bug, the more likely it will be fixed, because if no one can duplicate the problem, no one can fix it. A good test case has most of these attributes: fewest possible number of lines; few dependencies on external commands, modules, or libraries; runs on most platforms unimpeded; and is self-documenting.

      A good test case is almost always a good candidate to be on the perl test suite. If you have the time, consider making your test case so that it will readily fit into the standard test suite.

      Remember also to include all the exact error messages, if any. "Perl complained something" is not an exact error message.

      If you get a core dump (or equivalent), you may use a debugger (dbx, gdb, etc) to produce a stack trace to include in the bug report. NOTE: unless your Perl has been compiled with debug info (often -g), the stack trace is likely to be somewhat hard to use because it will most probably contain only the function names and not their arguments. If possible, recompile your Perl with debug info and reproduce the dump and the stack trace.

    • Can you describe the bug in plain English?

      The easier it is to understand a reproducible bug, the more likely it will be fixed. Anything you can provide by way of insight into the problem helps a great deal. In other words, try to analyze the problem (to the extent you can) and report your discoveries.

    • Can you fix the bug yourself?

      A bug report which includes a patch to fix it will almost definitely be fixed. Use the diff program to generate your patches (diff is being maintained by the GNU folks as part of the diffutils package, so you should be able to get it from any of the GNU software repositories). If you do submit a patch, the cool-dude counter at perlbug@perl.com will register you as a savior of the world. Your patch may be returned with requests for changes, or requests for more detailed explanations about your fix.

      Here are some clues for creating quality patches:
      Use the -c or -u switches to the diff program (to create a so-called context or unified diff). Make sure the patch is not reversed (the first argument to diff is typically the original file, the second argument your changed file). Make sure you test your patch by applying it with the patch program before you send it on its way. Try to follow the same style as the code you are trying to patch. Make sure your patch really does work (make test, if the thing you're patching supports it).

    • Can you use perlbug to submit the report?

      perlbug will, amongst other things, ensure your report includes crucial information about your version of perl. If perlbug is unable to mail your report after you have typed it in, you may have to compose the message yourself, add the output produced by perlbug -d and email it to perlbug@perl.com. If, for some reason, you cannot run perlbug at all on your system, be sure to include the entire output produced by running perl -V (note the uppercase V).

      Whether you use perlbug or send the email manually, please make your Subject line informative. "a bug" is not informative. Neither is "perl crashes" nor "HELP!!!" These don't help. A compact description of what's wrong is fine.

      Having done your bit, please be prepared to wait, to be told the bug is in your code, or even to get no reply at all. The Perl maintainers are busy folks, so if your problem is a small one or if it is difficult to understand or already known, they may not respond with a personal reply. If it is important to you that your bug be fixed, do monitor the Changes file in any development releases since the time you submitted the bug, and encourage the maintainers with kind words (but never any flames!). Feel free to resend your bug report if the next released version of perl comes out and your bug is still present.


    How do I report/fix a bug in a module/script?

    Use http://rt.cpan.org/ to open a bug ticket.

    Please contact the author of the module/script. The documentation of the module/script should contain a contact address or you can try CPANID@perl.org where CPANID is the authors CPANID.

    Most of the checklist in reporting bugs in Perl above applies for modules as well. Make your bug report as good as possible if you really want the bug fixed. If the module is included with the Perl distribution you should also follow the Perl bug reporting tips.

    我要如何报告/修复在模块/脚本中的bug呢?

    使用http://rt.cpan.org/去报告BUG。


    How do I go about maintaining a module when the author is unresponsive?

    Sometimes a module goes unmaintained for a while due to the author pursuing other interests, being busy, etc. and another person needs changes applied to that module and may become frustrated when their email goes unanswered. CPAN does not mediate or dictate a policy in this situation and rely on the respective authors to work out the details. If you treat other authors as you would like to be treated in the same situation the manner in which you go about dealing with such problems should be obvious.

    • Be courteous.
    • Be considerate.
    • Make an earnest attempt to contact the author.
    • Give it time. If you need changes made immediately, consider applying your patches to the current module, changing the version and requiring that version for your application. Eventually the author will turn up and apply your patches, offer you maintenance of the module or, if the author doesn't respond in a year, you may get maintenance by having interest.
    • If you need changes in order for another module or application to work, consider making the needed changes and bundling the new version with your own distribution and noting the change well in the documentation. Do not upload the new version under the same namespace to CPAN until the matter has been resolved with the author or CPAN.

    Simply keep in mind that you are dealing with a person who invested time and care into something. A little respect and courtesy go a long way.


    Is there a site for module bug reports/tests?

    Yes, through the diligence of Paul Schinder and a few others, we have CPAN Testers which is a collection of test results for modules on a number of different platforms. This information is also available when viewing module information on CPAN search.

    There is also http://rt.cpan.org/ where you might search for a module bug already reported and/or report a bug.


    Does CPAN provide download statistics for authors?

    No we don't. http://xxx.lanl.gov/help/faq/statfaq sums up our thoughts on the matter quite well.


    How do I mirror CPAN?

    Either an FTP or rsync client will do. Scantily clad virgins and pale moonlight are optional and are not included in the sales price.


    What do I need to mirror CPAN?

     

    • "Good" Internet connectivity, e.g. better than a 14.4 modem but not so much as an OC3.
    • Around 1GB of storage space. http://www.cpan.org/indices/du-k.gz tells you the current size of the CPAN.
    • An FTP or rsync client.

       

      • For FTP there is a Perl script named mirror (which assumes a command line FTP client):
        http://sunsite.org.uk/packages/mirror/

        The FTP address for the CPAN master site is:
        ftp://ftp.funet.fi/pub/languages/perl/CPAN/

         

      • and for rsync:
        http://rsync.samba.org/

        A few mirrors who have rsync addresses available for CPAN are:
        cpan.mirror.smartworker.org::CPAN
        theoryx5.uwinnipeg.ca::CPAN
        ftp.shellhung.org::CPAN
        ftp.funet.fi::CPAN
        ftp.gwdg.de::FTP/languages/perl/CPAN/
        ftp.leo.org::CPAN
        CPAN.piksi.itb.ac.id::CPAN
        ftp.iglu.org.il::CPAN
        gusp.dyndns.org::cpan
        ftp.kddlabs.co.jp::cpan
        cpan.teleglobe.net::CPAN
        ftp.sedl.org::cpan
        archive.progeny.com::CPAN
        mirrors.kernel.org::mirrors/CPAN
        mirrors.phenominet.com::CPAN
        mirror.csit.fsu.edu::CPAN
        csociety-ftp.ecn.purdue.edu::CPAN
         

        Once you have the rsync client installed on your system and the disk space mapped out, you may then add an entry to your crontab [ if using UNIX, AT if using Windows NT ] like the following example:

        0 20 * * * /usr/local/bin/rsync -av --delete ftp.funet.fi::CPAN /project/CPAN/ >/dev/null 2>&1

        AT 20:00 /every:M,T,W,Th,F,S,Su "C:/Program Files/Rsync/rsync -av --delete ftp.funet.fi::CPAN /project/CPAN/ >/dev/null 2>&1"


    I have Windows 2000/NT/98/95, how can I mirror CPAN?

    By using rsync for NT.


    Which CPAN site should I mirror?

    The one that gives the best bandwidth (where your mirror finishes quickest) and which is most up-to-date. Most up-to-date is, by definition, the CPAN master site ftp.funet.fi. Note that it lives in the GMT+2 time zone so please try not to mirror during working hours: 0600 to 1400 GMT/UTC. If you want to mirror from somewhere else, check the list at http://www.cpan.org/SITES.html or at http://mirror.cpan.org/.

    Please organize the mirroring with the corresponding FTP maintainer (their email addresses from the file http://www.cpan.org/MIRRORED.BY or http://mirror.cpan.org/) so that you will not overload their site and that your mirror starts just after theirs has finished.

    A few tips to keep in mind:

    • For your mirror site to be useful to your users you should mirror daily.
    • You can also provide a HTTP interface in addition to an FTP interface to CPAN if you wish to do so.
    • Consider also giving rsync access to your mirror. Many people like rsync because it's very bandwidth-friendly.
    • Remember to tell cpan@perl.org about all the access methods you provide to your mirror: ftp, http, or rsync (or any other methods).

    How do I register my mirror to make it a public resource?

    If you want to publicize your CPAN mirror (meaning that your mirror is publicly available), please use the on-line form at http://mirror.cpan.org/mirror.cgi or fill in the following template which can be found from the top of the file http://www.cpan.org/MIRRORED.BY:

    我要如何注册我的镜像站点以便公众可以访问呢?

    hostname.of.the.CPAN.mirroring.site:
    frequency = "daily/bidaily/.../weekly"
    dst_ftp = "ftp://the.same.host.name:/CPAN/mirror/directory/"
    dst_http = "http://the.same.host.name:/CPAN/mirror/directory/"
    dst_rsync = "the.same.host.name::CPAN"
    dst_location = "city, (area?, )country, continent (lat long)"
    dst_organisation = "full organisation name"
    dst_timezone = "GMT[+-]n"
    dst_bandwidth = "Approximate connection speed,e.g. T1, E3, etc."
    dst_contact = "email.address.to.contact@for.this.mirror"
    dst_src = "host.that.you.mirror.from"
    dst_loadbal = "Y" or "N" Join the load balancing pool for ftp.cpan.org
    dst_notes = "(optional field) access restrictions, for example?"
     

    There are plenty of examples of how to fill in the template file. When your template is ready, please send it to cpan@perl.org and you will be registered.

  • 相关阅读:
    php学习【1】
    网页项目源码笔记
    python学习笔记
    php集成开发环境xampp的搭建
    ubuntu18.04.1LTS系统远程工具secureCRT
    关于IT人的一些消遣区
    linux系统的启动过程简要分析
    【shell脚本学习-1】
    Linux命令总结--cat命令
    Linux命令总结--vi/vim命令
  • 原文地址:https://www.cnblogs.com/secbook/p/2655532.html
Copyright © 2020-2023  润新知