[Perl + MacOSX] 初心者です。LWP::Simpleを含んだスクリプトを実行しましたら、「Can't locate LWP/Simple.pm 」...のようなエラーが表示されました。どうやら、libwwwというものをインストールしなければならないようです。このインストール手続について、丁寧に解説しているサイトを教えて下さい。

回答の条件
  • URL必須
  • 1人2回まで
  • 登録:
  • 終了:2008/03/22 15:51:36
※ 有料アンケート・ポイント付き質問機能は2023年2月28日に終了しました。

ベストアンサー

id:m_nagase No.1

回答回数58ベストアンサー獲得回数8

ポイント38pt

PerlのモジュールはCPANというサイトに集積されています。

http://cpan.org/

ここから必要なモジュールを探してアーカイブをダウンロード・展開・インストール

してもいいのですが、Perlに付属している cpan というツールを使うと、これらの

作業を自動的に行ってくれます。

http://homepage3.nifty.com/toralu/MEMO/CPAN-wwwload.html

id:tententireman

どうもありがとうございます。

さっそく教えて頂いた通り試したのですが、下記のエラーが出てしまい、行き詰まってしまいました。

どこを変更すれば良いかよく分かりません。

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

2008/03/22 10:04:32

その他の回答1件)

id:m_nagase No.1

回答回数58ベストアンサー獲得回数8ここでベストアンサー

ポイント38pt

PerlのモジュールはCPANというサイトに集積されています。

http://cpan.org/

ここから必要なモジュールを探してアーカイブをダウンロード・展開・インストール

してもいいのですが、Perlに付属している cpan というツールを使うと、これらの

作業を自動的に行ってくれます。

http://homepage3.nifty.com/toralu/MEMO/CPAN-wwwload.html

id:tententireman

どうもありがとうございます。

さっそく教えて頂いた通り試したのですが、下記のエラーが出てしまい、行き詰まってしまいました。

どこを変更すれば良いかよく分かりません。

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

2008/03/22 10:04:32
id:m_nagase No.2

回答回数58ベストアンサー獲得回数8

ポイント32pt

現在のログインしているユーザーが管理者ではないため、ユーザーディレクトリ以下にモジュールをインストールしようとしたが必要な設定がないため失敗しているのだと思います。sudoコマンドを使って一時的に管理者モードにすると、システムの共通ライブラリにモジュールがインストールされるはずです。

sudo perl -MCPAN -e shell

パスワードを聞かれるので今ログインしているユーザーのパスワードを入力してください。

ユーザーディレクトリ以下にモジュールをインストールする場合は以下のサイトを参考に。

http://iandeth.dyndns.org/mt/ian/archives/000623.html

id:tententireman

回答ありがとうございます。

しかし、まだちょっと上手く行きません。

cpan> install LWP

で進んでいくのですが、

Checking if your kit is complete...

Looks good

Warning: prerequisite HTML::Tagset 0 not found.

Writing Makefile for LWP

  • Unsatisfied dependencies detected during [G/GA/GAAS/libwww-perl-5.808.tar.gz] -----

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...

http://search.cpan.org/~gaas/libwww-perl-5.79/

2008/03/22 15:50:38

コメントはまだありません

この質問への反応(ブックマークコメント)

トラックバック

  • MacOS XのPerlモジュール m_nagaseさんの日記 2008-03-22 13:00:12
    回答が2回までなのでこれ以上は回答できない。終了しなければコメントもできないが、見つけることを祈って補足情報をメモしておく。 MacOS Xでは、標準ではgcc等のコンパイラがインスト
「あの人に答えてほしい」「この質問はあの人が答えられそう」というときに、回答リクエストを送ってみてましょう。

これ以上回答リクエストを送信することはできません。制限について

回答リクエストを送信したユーザーはいません