Perl troubleshooting

The following is a compilation of the possible Perl errors one may encounter as well as their solutions.

Net::DNS

Error

Can't locate Net/DNS.pm in @INC

Solution

  • yum
yum install perl-Net-DNS
  • apt-get
apt-get install libnet-dns-perl
  • cpan
cpan -i Net::DNS

Version

Error

spamd[1234]: Can't locate version.pm in @INC

Solution

  • yum
yum install perl-version
  • apt-get
apt-get install libperl-version-perl
  • cpan
cpan -i version

Bundle::LWP

Error

Can't locate LWP/UserAgent.pm in @INC ...

Solution

  • yum
yum install perl-libwww-perl
  • apt-get
apt-get install libwww-perl
  • cpan
perl -MCPAN -e 'install Bundle::LWP'

Archive::Tar

Error

Can't locate Archive/Tar.pm in @INC

Solution

  • yum
yum install perl-Archive-Tar
  • apt-get
apt-get install perl-modules
  • cpan
cpan -i Archive::Tar

HTML::Parser

Error

Can't locate HTML/Parser.pm in @INC

Solution

  • yum
yum install perl-HTML-Parser
  • apt-get
apt-get install libhtml-parser-perl
  • cpan
cpan -i HTML::Parser

DBD::mysql

Error

Can't locate DBD::mysql.pm in @INC

Solution

  • yum
yum install perl-DBD-MySQL
  • apt-get
apt-get install libdbd-mysql-perl
  • cpan
cpan -i 'install Bundle::DBD::mysql'

ExtUtils::Embed

Error

Please install ExtUtils::Embed for /usr/bin/perl

Solution

  • yum
yum install perl-ExtUtils-Embed
  • apt-get
apt-get install perl-modules
  • cpan
cpan -i ExtUtils::Embed
>>> Creating lookups/Makefile for building dynamic modules
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
       LANGUAGE = (unset),
       LC_ALL = (unset),
       LC_CTYPE = "UTF-8",
       LANG = "C"
   are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Please install ExtUtils::Embed for /usr/bin/perl
make: *** [configure] Error 1

*** The make has failed, would you like to try to make again? (y,n):

where a reported solution is to use:

cd /usr/local/directadmin/custombuild
LC_ALL=C ./build exim

if you've already added the ExtUtils::Embed module, but are still getting the error.

NetAddr::IP

Error

REQUIRED module missing: NetAddr::IP

Solution

  • yum
yum install perl-NetAddr-IP.x86_64
  • apt-get
apt-get install libnetaddr-ip-perl
  • cpan
cpan -i NetAddr::IP

Compress::Raw::Zlib

Error

Can't locate Compress/Raw/Zlib.pm in @INC

Solution

  • yum
yum install perl-Compress-Raw-Zlib
  • apt-get
apt-get install libcompress-raw-zlib-perl
  • cpan
cpan -i Compress::Raw::Zlib

Crypt::OpenSSL::DSA

Error

perl: symbol lookup error: /usr/lib64/perl5/vendor_perl/auto/Crypt/OpenSSL/DSA/DSA.so: undefined symbol: Perl_Gthr_key_ptr

Solution

  • yum
yum install perl-Crypt-OpenSSL-DSA
  • apt-get
apt-get install libcrypt-openssl-dsa-perl
  • cpan
cpan -i Crypt::OpenSSL::DSA

Mail::SPF

Error

Error: Failed test 'POD test for blib/lib/Mail/SPF/Util.pm' at /usr/local/share/perl/5.24.1/Test/Pod.pm line 187.	

If you run into this perl Mail::SPF build error with cpan,:

root@server# cpan -i Mail::SPF

Reading '/root/.cpan/Metadata'
 Database was generated on Thu, 31 Aug 2017 09:17:03 GMT
Running install for module 'Mail::SPF'
Checksum for /root/.cpan/sources/authors/id/J/JM/JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz ok
Configuring J/JM/JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz with Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Mail-SPF' version 'v2.9.0'
 JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz
 /usr/bin/perl Build.PL --installdirs site -- OK
Running Build for J/JM/JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz
Building Mail-SPF
 JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz
 ./Build -- OK
Running Build test
t/00.00-class-misc.t .......... ok
t/00.01-class-util.t .......... ok
t/00.02-class-request.t ....... ok
t/00.03-class-result.t ........ ok
t/00.04-class-server.t ........ ok
t/00.05-class-macrostring.t ... ok
t/00.99-class-misc.t .......... ok
t/10.00-rfc4408.t ............. skipped: Mail::SPF::Test required for testing Mail::SPF's RFC compliance
t/10.01-rfc4406.t ............. skipped: Mail::SPF::Test required for testing Mail::SPF's RFC compliance
t/90-author-pod-validation.t .. 1/27
#   Failed test 'POD test for blib/lib/Mail/SPF/Util.pm'
#   at /usr/local/share/perl/5.24.1/Test/Pod.pm line 187.
# blib/lib/Mail/SPF/Util.pm (157): L<> starts or ends with whitespace
# blib/lib/Mail/SPF/Util.pm (157): L<> starts or ends with whitespace
# Looks like you failed 1 test of 27.
t/90-author-pod-validation.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/27 subtests

Test Summary Report
----------
t/90-author-pod-validation.t (Wstat: 256 Tests: 27 Failed: 1)
 Failed test:  3
 Non-zero exit status: 1
Files=10, Tests=159,  1 wallclock secs ( 0.05 usr  0.01 sys +  1.07 cusr  0.13 csys =  1.26 CPU)
Result: FAIL
Failed 1/10 test programs. 1/159 subtests failed.
 JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz
 ./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
 reports JMEHNLE/mail-spf/Mail-SPF-v2.9.0.tar.gz

a reported fix is to install it manually with a patch:

perl -MCPAN -e "get('Mail::SPF')"
cd ~/.cpan/sources/authors/id/J/JM/JMEHNLE/mail-spf/
tar -xzvf Mail-SPF-v2.9.0.tar.gz
cd Mail-SPF-v2.9.0/

#manually patched blib/lib/Mail/SPF/Util.pm with the changes from Util.pm-patch.gz found at https://rt.cpan.org/Public/Bug/Display.html?id=93241
#extracted here: http://files1.directadmin.com/services/all/perl_modules/Mail-SPF/Util.pm-patch
#basically just swapping out the 3 ! lines from top, to the bottom 3 ! lines.

perl Build.PL
./Build
./Build test
./Build install

Compilation of any package from CPAN manually:

If you want to install package version .

wget "http://www.cpan.org/modules/by-module/Archive/net-DNS-1.20.tar.gz"
tar xvzf "net-DNS-1.20.tar.gz"
cd "net-DNS-1.20"
perl Makefile.PL
make
make install
Last Updated: