Home | Mirror | Search

第 39 章 Perl Module

目錄

1. Module::Build
2. ExtUtils::MakeMaker
3. Test::Simple
4. Test::More
5. XML::Simple
6. LWP::Simple
7. Date::Manip
8. Parameter
8.1. Getopt::Std
8.2. Getopt::Long
9. Encode/Decode
9.1. Text::Iconv
9.2. Encode::Guess -- Guesses encoding from data
9.3. URI::Escape
10. Net::SSH::Expect
11. UDPM - Perl extension for User Dialogs
12. Curses::UI

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	
	

1. Module::Build

過程 39.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