h2xs

Perlプログラミング救命病棟を買って読む。書いてあることはPerl版Pragmatic Programmersなんですが、なんかコードが怪しい。で書いてみることに。

h2xsでモジュールの雛形を作ってみると、

$ perl -v

This is perl, v5.8.7 built for cygwin-thread-multi-64int

Copyright 1987-2005, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


$ h2xs -AXn MyModule::Sample::Hello
Defaulting to backwards compatibility with perl 5.8.7
If you intend this module to be compatible with earlier perl versions, please
specify a minimum perl version with the -b option.

Writing MyModule-Sample-Hello/lib/MyModule/Sample/Hello.pm
Writing MyModule-Sample-Hello/Makefile.PL
Writing MyModule-Sample-Hello/README
Writing MyModule-Sample-Hello/t/MyModule-Sample-Hello.t
Writing MyModule-Sample-Hello/Changes
Writing MyModule-Sample-Hello/MANIFEST

$ cd MyModule-Sample-Hello/

$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for MyModule::Sample::Hello

$ make test
cp lib/MyModule/Sample/Hello.pm blib/lib/MyModule/Sample/Hello.pm
/usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/MyModule-Sample-Hello....ok
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.18 cusr +  0.06 csys =  0.24 CPU)

ディレクトリ構成が洗練されてた。