仕事でPerl使う事があり、開発環境のDebianでCPANの設定をしてみる。

cpan は既に入っているようなので、 cpan コマンドを実行。

# cpan

cpanコマンドが使えない場合は、

# perl -MCPAN -e shell

「マニュアル設定しますか?」という質問に「no」と回答すると初期設定は完了。

# cpan

/etc/perl/CPAN/Config.pm initialized.

CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.

If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)

Are you ready for manual configuration? [yes] no

設定が失敗したら

以下のように設定ファイルを削除して、再度cpanを実行すれば、最初から設定が出来る。

# rm /etc/perl/CPAN/Config.pm