PerlのモジュールはCPANというサイトに集積されています。
ここから必要なモジュールを探してアーカイブをダウンロード・展開・インストール
してもいいのですが、Perlに付属している cpan というツールを使うと、これらの
作業を自動的に行ってくれます。
PerlのモジュールはCPANというサイトに集積されています。
ここから必要なモジュールを探してアーカイブをダウンロード・展開・インストール
してもいいのですが、Perlに付属している cpan というツールを使うと、これらの
作業を自動的に行ってくれます。
どうもありがとうございます。
さっそく教えて頂いた通り試したのですが、下記のエラーが出てしまい、行き詰まってしまいました。
どこを変更すれば良いかよく分かりません。
perl -MCPAN -e shell
Terminal does not support AddHistory.
Your configuration suggests that CPAN.pm should use a working
directory of
/Users/***/.cpan
Unfortunately we could not create the lock file
/Users/***/.cpan/.lock
due to permission problems.
Please make sure that the configuration variable
$CPAN::Config->{cpan_home}
points to a directory where you can write a .lock file. You can set
this variable in either
/System/Library/Perl/5.8.6/CPAN/Config.pm
or
/Users/***/.cpan/CPAN/MyConfig.pm
Could not open >/Users/***/.cpan/.lock: Permission denied
現在のログインしているユーザーが管理者ではないため、ユーザーディレクトリ以下にモジュールをインストールしようとしたが必要な設定がないため失敗しているのだと思います。sudoコマンドを使って一時的に管理者モードにすると、システムの共通ライブラリにモジュールがインストールされるはずです。
sudo perl -MCPAN -e shell
パスワードを聞かれるので今ログインしているユーザーのパスワードを入力してください。
ユーザーディレクトリ以下にモジュールをインストールする場合は以下のサイトを参考に。
回答ありがとうございます。
しかし、まだちょっと上手く行きません。
cpan> install LWP
で進んでいくのですが、
Checking if your kit is complete...
Looks good
Warning: prerequisite HTML::Tagset 0 not found.
Writing Makefile for LWP
HTML::Tagset
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]
Running make test
Delayed until after prerequisites
Running make install
Delayed until after prerequisites
Running install for module HTML::Tagset
Running make for P/PE/PETDANCE/HTML-Tagset-3.20.tar.gz
Checksum for /Users/***/.cpan/sources/authors/id/P/PE/PETDANCE/HTML-Tagset-3.20.tar.gz ok
HTML-Tagset-3.20/
HTML-Tagset-3.20/Tagset.pm
HTML-Tagset-3.20/Makefile.PL
HTML-Tagset-3.20/META.yml
HTML-Tagset-3.20/MANIFEST.SKIP
HTML-Tagset-3.20/MANIFEST
HTML-Tagset-3.20/README
HTML-Tagset-3.20/t/
HTML-Tagset-3.20/t/01_old_junk.t
HTML-Tagset-3.20/t/pod.t
HTML-Tagset-3.20/t/00_about_verbose.t
HTML-Tagset-3.20/Changes
Removing previously used /Users/***/.cpan/build/HTML-Tagset-3.20
CPAN.pm: Going to build P/PE/PETDANCE/HTML-Tagset-3.20.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for HTML::Tagset
-- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
Running make for G/GA/GAAS/libwww-perl-5.808.tar.gz
Is already unwrapped into directory /Users/***/.cpan/build/libwww-perl-5.808
CPAN.pm: Going to build G/GA/GAAS/libwww-perl-5.808.tar.gz
-- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
というメッセージが出ます。
正常にインストールされたのかは、どのように確認すれば良いのでしょう?
その後、ダウンロードしたものを手で当該フォルダに入れる方法で、perlが意図した通りに動くようになりました。
http://www.tech-arts.co.jp/macosx/macosx-jp/htdocs/17700/17741.h...
どうもありがとうございます。
さっそく教えて頂いた通り試したのですが、下記のエラーが出てしまい、行き詰まってしまいました。
どこを変更すれば良いかよく分かりません。
perl -MCPAN -e shell
Terminal does not support AddHistory.
Your configuration suggests that CPAN.pm should use a working
directory of
/Users/***/.cpan
Unfortunately we could not create the lock file
/Users/***/.cpan/.lock
due to permission problems.
Please make sure that the configuration variable
$CPAN::Config->{cpan_home}
points to a directory where you can write a .lock file. You can set
this variable in either
/System/Library/Perl/5.8.6/CPAN/Config.pm
or
/Users/***/.cpan/CPAN/MyConfig.pm
Could not open >/Users/***/.cpan/.lock: Permission denied