忍者ブログ
出来損ないのカメレオン

# perl -MCPAN -e shell
最初の起動時に質問が出てきます。これに答えながら、設定を行ないます。
Are you ready for manual configuration? [yes]
CPAN build and cache directory? [/root/.cpan]
Cache size for build directory (in MB)? [10]
Perform cache scanning (atstart or never)? [atstart]
Cache metadata (yes/no)? [yes]
Your terminal expects ISO-8859-1 (yes/no)? [yes]
Policy on building prerequisites (follow, ask or ignore)?
[ask]
基本的には、すべてデフォルトのままでOKです。
Enter を押せば、[ ] 内のデフォルトで設定されます。
Where is your gzip program? [/bin/gzip]
Where is your tar program? [/bin/tar]
Warning: unzip not found in PATH
Where is your unzip program? [] /bin/unzip
Where is your make program? [/usr/bin/make]
Warning: lynx not found in PATH
Where is your lynx program? [] /usr/local/bin/lynx
Where is your wget program? [/usr/bin/wget]
Where is your ncftpget program? [/usr/bin/ncftpget]
Where is your ftp program? [/usr/bin/ftp]
What is your favorite pager program? [/usr/bin/less]
What is your favorite shell? [/bin/bash]
各コマンドのパスを設定します。
たいてい標準で入っており、パスが自動で設定されますので、Enter でOKです。
もし「not found in PATH」と表示されたら、パスを入力します。
無くてもよいものもありますが、gzip、tar、make、lynx などは必須でしょう。
私の例では、Lynxが入っていませんでした。
(先にパスだけ設定して(緑の部分)、後でインストールしました。)
その他 unzip なども入っていないみたいですが、この辺は無視してかまいません。

※ Lynxのインストールについては、以下のサイトが参考になります。
 Installation Lynx for UNIX

質問は、まだ続きます。
Parameters for the 'perl Makefile.PL' command? []
Parameters for the 'make' command? []
Parameters for the 'make install' command? [] UNINST=1
Timeout for inactivity during Makefile.PL? [0]
「UNINST=1」というオプションを付けました。同名のモジュールが既に存在して競合
する場合に、古いものを消す設定です。

Your ftp_proxy?
Your http_proxy?
Your no_proxy?

(1) Africa
(2) Asia
(3) Central America
(4) Europe
(5) North America
(6) Oceania
(7) South America
Select your continent (or several nearby continents) [] 2

(1) China
(2) Indonesia
(3) Israel
(4) Japan
(5) Malaysia
(6) Philippines
(7) Republic of Korea
(8) Russian Federation
(9) Saudi Arabia
(10) Singapore
(11) Taiwan
(12) Thailand
Select your country (or several nearby countries) [] 4

(1) ftp://ftp.ayamura.org/pub/CPAN/
(2) ftp://ftp.cpan.jp/CPAN/
(3) ftp://ftp.dti.ad.jp/pub/lang/CPAN/
(4) ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
(5) ftp://ftp.kddlabs.co.jp/CPAN/
(6) ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/
(7) ftp://ftp.u-aizu.ac.jp/pub/CPAN
Select as many URLs as you like,
put them on one line, separated by blanks [] 2

Enter another URL or RETURN to quit: []
New set of picks:
  ftp://ftp.cpan.jp/CPAN/

エリアを選び、近くのCPANサーバーを選択します。
このサーバーから、モジュールを引っ張ってきます。
以上で設定は完了です。

----------------------------------------
# perl -MCPAN -e shell

cpan> install [モジュール名]
cpan> install Jcode

DB_File モジュール
cpan> install DB_File
DBI モジュール
cpan> install DBI
DBD::mysql モジュール
cpan> install DBD::mysql
DBD::mysql を入れる前に、DBI を入れてください。

cpan>q

install MIME:Entity


以下に、サニタイジングを行うコードを言語別に紹介しておく。ただし、これが唯一の書き方ではなく、ほかの方法で同様の機能が実施できるのであればそれでも構わない。

perl
$text =~ s/&/\&/g;
$text =~ s/</&lt;/g;
$text =~ s/>/&gt;/g;
$text =~ s/"/&quot;/g;

PR
ブログ内検索
Counter


カレンダー
06 2024/07 08
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
忍者ブログ [PR]