[[Perl]]

*準備 [#caaf82b9]
 事前に下記コマンドでCPANモジュールをインストールするための準備をします。
 # yum install perl-CPAN
 # yum install libyaml-devel
 # yum install perl-CGI

*インストール [#l49f1f22]
 # perl -MCPAN -e shell もしくは cpan
 cpan[1]>install CGI
 cpan[2]>quit

*インストール済みモジュールの確認方法 [#p5ca7ea5]
  # find `perl -e 'print "@INC"'` -name "*.pm" -print | grep CGI | xargs ls -l
 -r--r--r-- 1 root       root  262471 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/blib/lib/CGI.pm
 -r--r--r-- 1 root       root   18781 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/blib/lib/CGI/Carp.pm
 -r--r--r-- 1 root       root   16664 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/blib/lib/CGI/Cookie.pm
 -r--r--r-- 1 root       root     878 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/blib/lib/CGI/File/Temp.pm
 -r--r--r-- 1 root       root    9411 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/blib/lib/CGI/Pretty.pm
 -r--r--r-- 1 root       root   10789 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/blib/lib/CGI/Push.pm
 -r--r--r-- 1 root       root   11925 12月 18 18:20 2014 ./.cpan/build/CGI-4.13-CyqZua/blib/lib/CGI/Util.pm
 -r--r--r-- 1 root       root     139 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/blib/lib/Fh.pm
 -rw-r--r-- 1 root root 262471 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/lib/CGI.pm
 -rw-r--r-- 1 root root  18781 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/lib/CGI/Carp.pm
 -rw-r--r-- 1 root root  16664 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/lib/CGI/Cookie.pm
 -rw-r--r-- 1 root root    878 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/lib/CGI/File/Temp.pm
 -rw-r--r-- 1 root root   9411 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/lib/CGI/Pretty.pm
 -rw-r--r-- 1 root root  10789 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/lib/CGI/Push.pm
 -rw-r--r-- 1 root root  11925 12月 18 18:20 2014 ./.cpan/build/CGI-4.13-CyqZua/lib/CGI/Util.pm
 -rw-r--r-- 1 root root    139 12月 18 18:19 2014 ./.cpan/build/CGI-4.13-CyqZua/lib/Fh.pm
 
*インストール済みモジュールのバージョン確認 [#y052ca29]
 # perl -MCGI -e 'print $CGI::VERSION'
 3.51
~
***バージョン確認ワンライナー [#o2cd072d]
 # for i in CGI CGI::Cookie Image::Size File::Spec LWP::UserAgent DBI DBD::mysql;do perl -M${i} -e "print \$${i}::VERSION";echo " "${i};done

*トラブルシュート [#v05b7066]
 # perl -MCPAN -e shell
 Can't locate CPAN.pm in @INC
これは上記perl-CPANがインストールされていないときに表示されます。

~
*参考URL [#h3d14552]
http://www.ksknet.net/perl/perl.html

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS