免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1230 | 回复: 0
打印 上一主题 下一主题

Windows 下安装Perl cpan模块 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-07 13:14 |只看该作者 |倒序浏览

Windows XP 下安装Perl cpan模块  





  


1、从
www.cpan.org
搜索你所需要的模块,下载下来,一般是gz,或者tgz格式
2、用winRAR之类解压缩软件接压缩
3、进入COMMAN模式,进入到刚才解压缩的文件夹下,含有“Makefile.PL”文件的目录下:
依次运行:
        perl Makefile.PL
        nmake
        nmake test
        nmake install
安装就完成了.
我的系统是Windows XP, 安装的是ActivePerl-5.8.8.817-MSWin32-x86-257965.msi
具体的平台安装方法可参考cpan官方说明:
http://www.cpan.org/modules/INSTALL.html


A frequently asked question: "Where can I find make for Windows?". The answer is: "Download and use NMake".
Downloading NMake
Since Microsoft Windows hasn't in it's default install a make program needed to build the Perl modules, you have to download NMake 1.5 from the
Microsoft Knowledge Base, article 132084
page.
Installing NMake
Run the downloaded executable to extract the files. Copy both the NMAKE.EXE and the NMAKE.ERR file to your Perl bin directory, normally C:\Perl\bin. Make sure that you copy the NMAKE.ERR file as well.
Example of an NMake session
Normally building Perl modules and installing them consist of the following steps:
  • perl Makefile.pl
  • make
  • make test
  • make install
    Just replace make with nmake, and in many cases this will result in a working module (or modules) installed in the proper location(s).
    Below follows an example of building the Net-Google Perl module, and installing it. See
    Net-Google with ActiveState Perl
    for more information.
    perl Makefile.PL
    Checking if your kit is complete...
    Looks good
    Writing Makefile for Net::Google
    nmake
    Microsoft (R) Program Maintenance Utility   Version 1.50
    Copyright (c) Microsoft Corp 1988-94. All rights reserved.
    cp lib/Net/Google/Search.pm blib\lib\Net\Google\Search.pm
    cp lib/Net/Google.pm blib\lib\Net\Google.pm
    cp lib/Net/Google/tool.pm blib\lib\Net\Google\tool.pm
    cp lib/Net/Google/Spelling.pm blib\lib\Net\Google\Spelling.pm
    cp lib/Net/Google/Cache.pm blib\lib\Net\Google\Cache.pm
    cp lib/Net/Google/Services/GoogleSearch.wsdl blib\lib\Net\Google
    \Services\GoogleSearch.wsdl
    cp lib/Net/Google/Service.pm blib\lib\Net\Google\Service.pm
    cp lib/Net/Google/Response.pm blib\lib\Net\Google\Response.pm
    nmake test
    Microsoft (R) Program Maintenance Utility   Version 1.50
    Copyright (c) Microsoft Corp 1988-94. All rights reserved.
        C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "tes
    t_harness(0, 'blib\lib', 'blib\arch')" t\000-key.t t\001-search.
    t t\002-spelling.t t\003-cache.t t\000-key.........#
    # The Google API web service requires that you provide create a
    Google Account and obtain a license key
    # This key is then passed with each request you make to the Goog
    le servers.
    # If you do not already have a Google Account, you can sign up f
    or one here:
    # http://www.google.com/apis/
    #
    # Please enter your Google API key:
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    t\000-key.........ok
    t\001-search......ok
    t\002-spelling....ok
    t\003-cache.......ok
    All tests successful.
    Files=4, Tests=18, 103 wallclock secs ( 0.00 cusr +  0.00 csys =
    0.00 CPU)
    nmake install
    Microsoft (R) Program Maintenance Utility   Version 1.50
    Copyright (c) Microsoft Corp 1988-94. All rights reserved.
    Installing C:\Perl\site\lib\Net\Google.pm
    Installing C:\Perl\site\lib\Net\Google\Cache.pm
    Installing C:\Perl\site\lib\Net\Google\Response.pm
    Installing C:\Perl\site\lib\Net\Google\Search.pm
    Installing C:\Perl\site\lib\Net\Google\Service.pm
    Installing C:\Perl\site\lib\Net\Google\Spelling.pm
    Installing C:\Perl\site\lib\Net\Google\tool.pm
    Installing C:\Perl\site\lib\Net\Google\Services\GoogleSearch.wsd
    l
    Appending installation info to C:\Perl\lib/perllocal.pod

    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/15138/showart_416471.html
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP