Can't locate Bench.pm in #INC [Perl] [duplicate] - perl

This question already has answers here:
What's the easiest way to install a missing Perl module?
(24 answers)
Closed 9 years ago.
I have a problem when i compile my perl program :
it mention :
Can't locate Bench.pm in #INC (#INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at test.pl line 4.
BEGIN failed--compilation aborted at test.pl line 4.
Any idea please?
Thanks

Install Bench as you would any other CPAN module, e.g. with cpanm, cpanp or cpan.
You might want to first use perlbrew to install a local (and newer) version of Perl so you won't be touching anything related to the system Perl installation.

First, check if you have installed Bench module:
%> perl -MBench -e 1
If you get the error message, you have to install it:
%> cpan Bench

Related

we are unable to access the CGI perl application after Linux OS upgrade from RHEL6 to RHEL7

we are unable to access the CGI perl application after Linux OS upgrade from RHEL6 to RHEL7.
Can't locate Carp.pm in #INC (#INC contains: /local/silas/lib2 /local/silas/lib/site_perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/share/perl5/CGI.pm line 3.
BEGIN failed--compilation aborted at /usr/share/perl5/CGI.pm line 3.
Compilation failed in require at /ford/eccws6/apache/htdocs/index.cgi line 9.
BEGIN failed--compilation aborted at /ford/eccws6/apache/htdocs/index.cgi line 9.
Please tell me what is exactly caused for this issue and do need to make any changes in setup?
Like #Shawn said in a comment, RedHat splits off core Perl modules into separate packages that don't get installed when you install perl or perl-core.
I believe you need the perl-Carp package:
yum install perl-Carp

Can't locate XML/Writer.pm in #INC . Cant locate DBD/CSV.pm in #INC

I tried using CPAN module XML::Writer, but I am getting following error:
Can't locate XML/Writer.pm in #INC (#INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at testing.pl line 3.
BEGIN failed--compilation aborted at testing.pl line 3.
I checked for installation of the module using - perldoc XML::Writer and the document doesn't seems to be exist.
As I don't have the privilege to install the package as I am not the system administrator.
I have similar error for DBD::CSV too.
What can be done if a particular CPAN module not available/installed in the server where I am working and how do I install it without admin access?
Just an idea. I can't write this as an comment, because I'm a new user here and have not enough reputation to do this.
You can download the module files as XML-Writer-0.625.tar.gz from CPAN website https://metacpan.org/pod/XML::Writer and extract it in the same folder as your perl file.

How to resolve #INC related issue in Perl

I am getting the following error, while run the perl script.
Can't locate File/stat.pm in #INC (you may need to install the File::stat module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/local/share/perl/5.24.1/Path/Class/Entity.pm line 9.
I have tried to install the missing package thorugh CPAN install.
When i tried CPAN ,I am getting the following error
Can't locate File/Find.pm in #INC (you may need to install the File::Find module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl/5.24/CPAN/CacheMgr.pm line 8.
Can u please any one help me to resolve the issue.
File::stat has been a part of the standard Perl distribution since Perl 5.004 in 1997. There should never be a reason to install it separately. If you find yourself in that situation, then something has gone badly wrong in your Perl installation and I would strongly suggest reinstalling from scratch using the pre-built packages supplied by your Linux distribution.

CPAN module installation problems

I have installed cpan module by cpan install semantics3 and cpanm install semantics3 but still it is throwing error like this
Can't locate Net/Semantics3.pm in #INC (you may need to install the Net::Semantics3 module) (#INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at extraction.pl line 1.
BEGIN failed--compilation aborted at extraction.pl line 1.
You need to specify the whole module name for installation, not just the last part. Thus, your command should be
cpan Net::Semantics3
instead of just install semantics3.
From its GitHub repo, you can try:
perl -MCPAN -e "install Net::Semantics3"

Running the perl source [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What's the easiest way to install a missing Perl module?
I downloaded the source code for a perl script. When I try to run it, however, it gives me the following error:
Can't locate Palm/PDB.pm in #INC (#INC contains: /root/Desktop /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /etc/perl/MobiPerl/MobiFile.pm line 3.
BEGIN failed--compilation aborted at /etc/perl/MobiPerl/MobiFile.pm line 3.
Compilation failed in require at ./html2mobi line 21.
BEGIN failed--compilation aborted at ./html2mobi line 21.
What can I possibly do to run this script?
You need to download the right module from CPAN - in this case,
Palm::PDB
Answers to this question explain how to install missing Perl modules.
You will need to find and install the module Palm::PDB from somewhere. It is available on CPAN.