1754315 Members
2647 Online
108813 Solutions
New Discussion юеВ

Perl Problem

 
SOLVED
Go to solution
Ernest Small
Advisor

Perl Problem

When trying to run a small perl script I get the following error...

# /root/bin/df.pl
Can't find 'boot_Filesys__Statvfs' symbol in /opt/perl/lib/site_perl/PA-RISC1.1/auto/Filesys/Statvfs/Statvfs.sl
at /opt/perl/lib/site_perl/Filesys/Df.pm line 7
Compilation failed in require at /opt/perl/lib/site_perl/Filesys/Df.pm line 7.
BEGIN failed--compilation aborted at /opt/perl/lib/site_perl/Filesys/Df.pm line 7.
Compilation failed in require at /root/bin/df.pl line 4.
BEGIN failed--compilation aborted at /root/bin/df.pl line 4.

I've also attached the script to review.

Please help
3 REPLIES 3
Jeffrey S. Sims
Trusted Contributor

Re: Perl Problem

looks to me as if you are missing the required modules as stated in the lines:

use Filesys::Df;
use File::Basename;

If you do not have these modules you can get them by using the command:

perl -MCPAN -e "install Filesys::Df"
and
perl -MCPAN -e "install File::Basename"

Hope this helps.
MANOJ SRIVASTAVA
Honored Contributor

Re: Perl Problem

It may also be there that there are more than one version of perl , genrally
HPUX comes witha version which is like version 4 in some other directory like /usr/contrib/bin and the perl which is installed goes to /opt/perl so please be sure that u are using /opt/perl/bin/perl for the compilation . You can also rename the olders version as it amy come in the path before.


Manoj Srivastava
Ralph Grothe
Honored Contributor
Solution

Re: Perl Problem

Hi Ernest,

first check if your Perl compiler can find the imported modules from its @INC paths.

At the shell just test if this works without any complaints from Perl

perl -MFilesys::Df -e0

if you get something like this:

# perl -MFilesys::Df -e0
Can't locate Filesys/Df.pm in @INC (@INC contains: /opt/perl5/lib/5.6.1/PA-RISC2
.0 /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0 /opt/perl5/lib
/site_perl/5.6.1 /opt/perl5/lib/site_perl .).
BEGIN failed--compilation aborted.

chances are that either the module isn't installed, or installed in the "wrong" place, or your @INC array is set wrong.

Of course you are free to install modules whereever you like or are restricted to, viz. you have no root privileges.
Then you should insert the

use lib '/path/to/your/module_dir';

pragma in your code which imports the module.

To check which modules have been installed that don't belong to the standard Perl suite you can read this POD

perldoc perllocal

You can either install it - as laready posted - through the CPAN module, which however can become a little bit tricky if you are (like me) sitting behind a proxy.
Then you need to configure your CPAN module to send http and ftp get requests over your proxy.
But if you haven't done this before it's probably easier for you to download and install the module manually.

You can get Filesys::Df from here:

http://www.cpan.org/modules/by-module/Filesys/

after untaring read all READMEs and INSTALLs, and install the module as pointed out therein

(mostly it's just the usual mantra
perl Makefile.PL
make
make test
make install
)

On the other hand your error messages about missing symbols to me sounds more like you need to convert the C header files.
Read the POD of h2ph, and execute the command mentioned there

e.g.

cd /usr/include && h2ph *.h sys/*.h
Madness, thy name is system administration