CPANPLUSってなんだ?からはじめる

昔は "apt-get"便利だ〜。
cpan て何?と思ってました。
つうかdebianperlモジュールもパッケージで入れれるからね。
で、仕事中にperl使うと Solaris, Redhat, cygwin(MyPC) という環境になったので、、、最近は "cpan"便利だ〜、となったわけです。

YAPC2008で、CPANPLUSという単語が出てきて??? 何時からこんなものが。
ということで、使ってみる。


# cpanp
CPANPLUS::Shell::Default -- CPAN exploration and module installation (v0.84)
*** Please report bugs to .
*** Using CPANPLUS::Backend v0.84.
*** ReadLine support available (try 'i Term::ReadLine::Perl').

*** Type 'p' now to show start up log

Did you know...
You can update CPANPLUS by running: 's selfupdate'
CPAN Terminal>

とりあえず、help読んだりスタートアップメッセージ通り実行してみたり使ってみる。


CPAN Terminal> i Term::ReadLine::Perl

[MSG] No '/root/.cpanplus/custom-sources' dir, skipping custom sources
Installing Term::ReadLine::Perl (1.0302)
Running [/usr/local/bin/perl /usr/local/bin/cpanp-run-perl /root/.cpanplus/5.10.0/
build/Term-ReadLine-Perl-1.0302/Makefile.PL ]...
Checking if your kit is complete...
Looks good
Writing Makefile for Term::ReadLine
Running [/usr/bin/make test ]...
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
Features present: preput 1 getHistory 1 addHistory 1 attribs 1 ornaments 1 appname
1 minline 1 autohistory 1 newTTY 1 tkRunning 1 setHistory 1
Flipping rl_default_selected each line.
Enter arithmetic or Perl expression: exit
*** Install log written to:
/root/.cpanplus/install-logs/Term-ReadLine-Perl-1.0302-1213804281.log

Module 'Term::ReadLine::Perl' installed successfully
No errors installing all modules

CPAN Terminal>


CPAN Terminal> i XML::Parser

Installing XML::Parser (2.36)
Running [/usr/local/bin/perl /usr/local/bin/cpanp-run-perl /root/.cpanplus/5.10.0/
build/XML-Parser-2.36/Makefile.PL ]...
Checking if your kit is complete...
Looks good
Warning: prerequisite LWP 0 not found.
Writing Makefile for XML::Parser::Expat
Writing Makefile for XML::Parser

Module 'XML::Parser' requires 'LWP' to be installed

If you don't wish to see this question anymore
you can disable it by entering the following commands on the prompt:
's conf prereqs 1; s save'

Should I install this module? [Y/n]: n
Running [/usr/bin/make test ]...
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(
0, 'blib/lib', 'blib/arch')" t/*.t
t/astress.........ok
t/cdata...........ok
t/decl............ok
t/defaulted.......ok
t/encoding........ok
t/external_ent....Couldn't load LWP based external entity handler
Switching to file-based external entity handler
(To avoid this message, use NoLWP option to XML::Parser)
ok
t/file............ok
t/finish..........ok
t/namespaces......ok
t/parament........Couldn't load LWP based external entity handler
Switching to file-based external entity handler
(To avoid this message, use NoLWP option to XML::Parser)
ok
t/partial.........ok
t/skip............ok
t/stream..........ok
t/styles..........ok
All tests successful.
Files=14, Tests=130, 4 wallclock secs ( 1.63 cusr + 0.81 csys = 2.44 CPU)
*** Install log written to:
/root/.cpanplus/install-logs/XML-Parser-2.36-1213804553.log

Module 'XML::Parser' installed successfully
No errors installing all modules

CPAN Terminal>


CPAN Terminal> i LWP

Installing LWP (5.813)
...
Checking for URI........... failed
Can't locate URI.pm in @INC (@INC contains: /usr/local/lib/perl5/5.10.0/i86pc-sol
aris-thread-multi /usr/local/lib/perl5/5.10.0 /usr/local/lib/perl5/site_perl/5.10
.0/i86pc-solaris-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 .) at /root/.
cpanplus/5.10.0/build/libwww-perl-5.813/Makefile.PL line 147, line 8.

The URI module must be installed. WWW without URIs would not
be that great :-)
...
Should I install this module? [Y/n]:
...
Should I install this module? [Y/n]:
...
Module 'LWP' installed successfully
No errors installing all modules

"i モジュール名"でインストールされていきます。依存モジュールも取ってくてくれるので便利です。
ただ、、、今のところ cpanとの違いがわかっていません。
後は設定の中に proxyの設定がないですね(cpanにはあったと思う)。http_proxyとか環境変数が使われるのかな?

ぉ、"続・初めてのPerl"にも数行だけCPANPLUSが書いてあった。。。