Home | Mirror | Search | 雜文 | ITEYE 博客 | OSChina 博客 | 51CTO 博客

第 6 章 Perl Module

目錄

6.1. Module::Build
6.2. ExtUtils::MakeMaker
6.3. Test::Simple
6.4. Test::More
6.5. XML::Simple
6.6. LWP::Simple
6.7. Date::Manip
6.8. Parameter
6.8.1. Getopt::Std
6.8.2. Getopt::Long
6.9. Encode/Decode
6.9.1. Text::Iconv
6.9.2. Encode::Guess -- Guesses encoding from data
6.9.3. URI::Escape
6.10. Net::SSH::Expect
6.11. UDPM - Perl extension for User Dialogs
6.12. Curses::UI
6.13. WWW::Mechanize

How do I install XML::Simple?

On Unix systems, try:

 perl -MCPAN -e 'install XML::Simple'
	

If that doesn't work, download the latest distribution from ftp://ftp.cpan.org/pub/CPAN/authors/id/G/GR/GRANTM , unpack it and run these commands:

perl Makefile.PL
make
make test
make install
	

On Win32, if you have a recent build of ActiveState Perl (618 or better) try this command:

ppm install XML::Simple
	

6.1. Module::Build

過程 6.1. Module::Build step by setp

  1. Build.PL

    $ cat Build.PL
    use Module::Build;
    
    Module::Build->new
    (	module_name => 'My::Module',
    	license => 'perl',
        dist_version => '1.0',
    )->create_build_script;
    				
  2. perl Build.PL

    $ perl Build.PL
    Checking prerequisites...
    Looks good
    
    Creating new 'Build' script for 'My-Module' version '1.0'
    				
  3. Build

    $ ./Build
    Copying lib/My/Module.pm -> blib/lib/My/Module.pm
    				
  4. Build test

    $ ./Build test
    t/hello....ok
    All tests successful.
    Files=1, Tests=1,  0 wallclock secs ( 0.02 cusr +  0.01 csys =  0.03 CPU)
    				

    --test_files

    $ ./Build test --test_files t/hello.t
    				
comments powered by Disqus