DAHDI - Perl @INC path problems

I am building a new system and running into pathing problems.
Start with Centos 6.4 minimial install.
installed all the updates via yum update
yum install -y make wget openssl-devel ncurses-devel newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel
downloaded perl 5.18.1 from cpan and installed
downloaded dahdi-linux-complete-2.7.0+2.7.0 untared and ran make && make install && make config
so far everything went as planned
then service dahdi start - received the following on the console

Loading DAHDI hardware modules:
wct4xxp: [ OK ]
wcte12xp: [ OK ]
wct1xxp: [ OK ]
wcte11xp: [ OK ]
wctdm24xxp: [ OK ]
wcfxo: [ OK ]
wctdm: [ OK ]
wcb4xxp: [ OK ]
wctc4xxp: [ OK ]
xpp_usb: [ OK ]

Can’t locate Dahdi.pm in @INC (@INC contains: /usr/sbin /usr/sbin/perl_modules /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /usr/sbin/dahdi_hardware line 15.
BEGIN failed–compilation aborted at /usr/sbin/dahdi_hardware line 15.
Can’t locate Dahdi.pm in @INC (@INC contains: /usr/sbin /usr/sbin/perl_modules /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /usr/sbin/dahdi_registration line 14.
BEGIN failed–compilation aborted at /usr/sbin/dahdi_registration line 14.
Running dahdi_cfg: [ OK ]
Can’t locate Dahdi/Xpp.pm in @INC (@INC contains: /usr/sbin /usr/sbin/perl_modules /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /usr/sbin/xpp_sync line 15.
BEGIN failed–compilation aborted at /usr/sbin/xpp_sync line 15.
[
a find gives

[root@wolverine /]# find -name Dahdi.pm
./usr/src/dahdi-linux-complete-2.7.0+2.7.0/tools/xpp/perl_modules/Dahdi.pm
./usr/local/lib/perl5/site_perl/5.18.1/Dahdi.pm
[root@wolverine /]#

Without changing the @INC and rebuilding perl is there any other solution?

Hi larrywest,

I’m (wildly) guessing that the root of the problem is that Perl was installed from CPAN and not from the distribution and wasn’t configured to support multiple installations of perl. When DAHDI was installed, “/usr/local/lib/perl5/site_perl/5.18.1” was the location of the site library as returned from the command (run on my machine so the version is different):

$ perl -V:sitelib
sitelib='/usr/local/lib/perl5/site_perl/5.16.2';

But when you are now trying to run perl the sitelib is no longer in the @INC path (again the following output is on my machine):

$ perl -e 'print("@INC\n");'
/usr/local/lib/perl5/site_perl/5.16.2/x86_64-linux /usr/local/lib/perl5/site_perl/5.16.2 /usr/local/lib/perl5/5.16.2/x86_64-linux /usr/local/lib/perl5/5.16.2 /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .

I think your best bet is to fix your Perl installation since otherwise you might have problems running multiple versions on your machine.

If you cannot rebuild, you could also try adding /usr/local/lib/perl5/site_perl/5.18.1 to the PERL5LIB environment variable.