[Perl]XML::Parserがインストールできないときの対処法

$ cpanm Amazon::S3
--> Working on Amazon::S3
Fetching http://www.cpan.org/authors/id/T/TI/TIMA/Amazon-S3-0.45.tar.gz ... OK
Configuring Amazon-S3-0.45 ... OK
==> Found dependencies: XML::Simple
--> Working on XML::Simple
Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-Simple-2.20.tar.gz ... OK
Configuring XML-Simple-2.20 ... OK
==> Found dependencies: XML::SAX::Expat
--> Working on XML::SAX::Expat
Fetching http://www.cpan.org/authors/id/B/BJ/BJOERN/XML-SAX-Expat-0.40.tar.gz ... OK
Configuring XML-SAX-Expat-0.40 ... OK
==> Found dependencies: XML::Parser
--> Working on XML::Parser
Fetching http://www.cpan.org/authors/id/T/TO/TODDR/XML-Parser-2.41.tar.gz ... OK
Configuring XML-Parser-2.41 ... OK
Building and testing XML-Parser-2.41 ... FAIL
! Installing XML::Parser failed. See /home/dqneo/.cpanm/build.log for details.
~/.cpanm/build.logを見てみると、
/home/dqneo/perl5/perlbrew/perls/perl-5.16.1/bin/perl /home/dqneo/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1/ExtUtils/xsubpp -noprototypes -typemap /home/dqneo/perl5/perlbrew/perls/perl-5.16.1/lib/5.1
6.1/ExtUtils/typemap -typemap typemap  Expat.xs > Expat.xsc && mv Expat.xsc Expat.c
cc -c   -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"2.41\" -DXS_VERSION=\"2.41\" -fPIC "-I/home/dqneo/perl5/perlbrew/perls/p
erl-5.16.1/lib/5.16.1/x86_64-linux/CORE"   Expat.c
Expat.xs:12:19: error: expat.h: そのようなファイルやディレクトリはありません
Expat.xs:60: error: expected specifier-qualifier-list before 'XML_Parser'
なるほど、ライブラリが足りないということですね。
exapt-develを入れれば良さそうです。
sudo yum install  expat-devel
cpanm  Amazon::S3
これで解決しました!
カテゴリ: