How to install libdata-validate-ip-perl in centos - perl

I'm trying to use IP in my perl script and i got module not found error. When i tried to install it with dnf im getting no match found for the package.
use Data::Validate::IP;
Can't locate Data/Validate/IP.pm in #INC (you may need to install the
Data::Validate::IP module) (#INC contains: ../utils
/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 ../utils/VM.pm line 5. BEGIN
failed--compilation aborted at ../utils/VM.pm line 5. Compilation
failed in require at ./myscript.pl line 37.
#dnf install libdata-validate-ip-perl
Extra Packages for Enterprise Linux 8 - Epel (Intel mirror) 5.6 kB/s | 4.7 kB 00:00
Last metadata expiration check: -1596 days, 2:25:26 ago on Wed 09 Nov 2022 09:59:43 AM IST.
No match for argument: libdata-validate-ip-perl
Error: Unable to find a match: libdata-validate-ip-perl
Looking for suggestions to install perl missing modules

"libdata-validate-ip-perl" would be the name of the package on Debian-based distributions, such as Ubuntu.
Redhat-based distributions use a different naming convention for their packages. Try "perl-Data-Validate-IP".

I would use
sudo cpan Data::Validate::IP
See here https://perldoc.perl.org/cpan

Related

change install location of files in rpm generated with cpan2rpm

I am trying to generate RPMs with cpan2rpm command.
The generated rpm places files in /usr/local/share/perl5 instead of /usr/share/perl5.
cpan2rpm help doesn't seem to mention any option to do this.
Is it possible to change the location to /usr/share/perl5
command used
cpan2rpm --version 0.27 --release 1000000000.el8 --debug=1 --packager=XXXXXXX --distribution=unknown --author XXXXXXX (unknown) --no-sign Catalyst-Plugin-Session-0.40.tar.gz
perl version 5.26
as suggested in comments, I had configured the environment variable
export PERL_INSTALL_ROOT=/usr/share/perl5
but still the files are being generated to /usr/local/share/perl5
$ rpm -qlp /output/perl-Catalyst-Plugin-Session-0.40-1000000000.el8.noarch.rpm
/usr/local/share/man
/usr/local/share/man/man3
/usr/local/share/man/man3/Catalyst::Plugin::Session.3pm
/usr/local/share/man/man3/Catalyst::Plugin::Session::State.3pm
/usr/local/share/man/man3/Catalyst::Plugin::Session::Store.3pm
/usr/local/share/man/man3/Catalyst::Plugin::Session::Store::Dummy.3pm
/usr/local/share/man/man3/Catalyst::Plugin::Session::Test::Store.3pm
/usr/local/share/man/man3/Catalyst::Plugin::Session::Tutorial.3pm
/usr/local/share/perl5/Catalyst
/usr/local/share/perl5/Catalyst/Plugin
/usr/local/share/perl5/Catalyst/Plugin/Session
/usr/local/share/perl5/Catalyst/Plugin/Session.pm
/usr/local/share/perl5/Catalyst/Plugin/Session/State.pm
/usr/local/share/perl5/Catalyst/Plugin/Session/Store
/usr/local/share/perl5/Catalyst/Plugin/Session/Store.pm
/usr/local/share/perl5/Catalyst/Plugin/Session/Store/Dummy.pm
/usr/local/share/perl5/Catalyst/Plugin/Session/Test
/usr/local/share/perl5/Catalyst/Plugin/Session/Test/Store.pm
/usr/local/share/perl5/Catalyst/Plugin/Session/Tutorial.pod
/usr/share/doc/perl-Catalyst-Plugin-Session
/usr/share/doc/perl-Catalyst-Plugin-Session/Changes
/usr/share/doc/perl-Catalyst-Plugin-Session/README
/usr/share/doc/perl-Catalyst-Plugin-Session/inc
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install.pm
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install/AuthorTests.pm
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install/Base.pm
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install/Can.pm
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install/Fetch.pm
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install/Makefile.pm
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install/Metadata.pm
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install/Win32.pm
/usr/share/doc/perl-Catalyst-Plugin-Session/inc/Module/Install/WriteAll.pm

Executing DB2 commands '' db2start: command not found ''

I have one virtual server running on centos7. I configure it for the Nagios monitoring tool. I created the config file etc. I have 9 DB instances. When I migrated the DB config file with Nagios(adding to the Nagios )
I saw this error code on http://mysiteipaddr/nagios
CRITICAL - cannot connect to db.ipaddress.com. install_driver(DB2) failed: Can't locate DBD/DB2.pm in #INC (#INC contains: /usr/local/nagios/libexec /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 (eval 10) line 3.
After this error, I realize the DB2 is not installed on my machine. I've installed the DB2 drivers and when I execute this command I'm facing this output.
db2ls
-------------------------------------------------------------------------------------------------------------------
/opt/ibm/db2/V9.7 11.1.1.1 1 Fri Jan 31 11:33:28 2020 +03 0
[root#backup ~]#
But when I want to execute DB2 command like db2start, db2stop, db2status, it won't execute and I got this error code.
bash: db2stop: command not found
bash: db2start:command not found
Do you have an instance created? run /opt/ibm/db2/V9.7/instance/db2ilist
Please check the folder /home/tobe/sqllib/adm for db2start and db2stop commands. You can also define an alias if you want to call them directly.
Install below package in all of the instances:
yum -y install perl-CPAN
hope so this will be helpful for you....!!!!

Not installed or installed?

I have a problem in installing modules CPAN on my pc.
I wanted to install a module from CPAN and the problem is ... If i do that command :
perl -MCPAN -e 'install XML::DT'
The answer is :
XML::DT is up to date (0.63).
But when i try to run my program with the module XML::DT, it tells me that i don't have installed !
So... What options do i have to solve this?
Error given to me is :
Can't locate XML/DT.pm in #INC (#INC contains:
/Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16
/Network/Library/Perl/5.16/darwin-thread-multi-2level
/Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2
/System/Library/Perl/5.16/darwin-thread-multi-2level
/System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.16 .) at ./EX.pl line 2.
BEGIN failed--compilation aborted at ./EX.pl line 2.

Perl module broke my windows xampp installation

PROBLEM: In the process of trying to install gitstat on a Windows7 machine I broke my xampp Apache installation. Now I can't get gitstat or apache to work.
APACHE ERROR:
[error] Can't load Perl file: C:/xampp/apache/conf/extra/startup.pl for server localhost:80, exiting...`
Other people have reported this issue being caused by the PERL5LIB environment variable, but that variable does not exist on my machine.
WHAT I DID / GITSTAT ERROR:
I needed the SOAP::Lite module installed so I followed the windows guide here: http://soaplite.com/install.html
As far as I could tell I installed the module successfully, console output below
cpan[1]> install SOAP::Lite
CPAN: Storable loaded ok (v2.21)
Going to read '\xampp\perl\bin\.cpan\Metadata'
Database was generated on Wed, 27 Jun 2012 02:47:03 GMT
SOAP::Lite is up to date (0.714).
I saw a SOAP directory in perl/site/lib which (to me) means that the module should be available. When I look in my perllocal.pod file SOAP:Lite is in there.
Part of the gitstat installation instructions say to copy the Lite.pm file from perl/site/lib/SOAP into gitstat\gstat_pl\lib
However, when I try to perform step nine of gitstat installation (perl gitstat.pl HEAD) I get the following:
C:\xampp\htdocs\gitstat\gstat_pl>perl gitstat.pl HEAD
Supported versions:
BEGIN failed--compilation aborted at C:/xampp/perl/site/lib/SOAP/Lite.pm line 34
86.
Compilation failed in require at C:/xampp/perl/site/lib/SOAP/Constants.pm line 1
3.
BEGIN failed--compilation aborted at C:/xampp/perl/site/lib/SOAP/Constants.pm li
ne 13.
Compilation failed in require at lib/Lite.pm line 3444.
BEGIN failed--compilation aborted at lib/Lite.pm line 3444.
Compilation failed in require at gitstat.pl line 30.
If I don't copy the file from perl/site/lib/SOAP then I get
C:\xampp\htdocs\gitstat\gstat_pl>perl gitstat.pl HEAD
Can't locate lib/Lite.pm in #INC (#INC contains: C:/xampp/perl/lib C:/xampp/perl
/site/lib .) at gitstat.pl line 30.
I don't understand why CPAN didn't install the Lite.pm module in the #INC path or why the compilation might fail when the module is available, or most importantly why my Apache install is broken. Also I'm very new to Perl and CPAN and my understanding of Apache is primitive so simpler explanations would be greatly appreciated.

Perl - Getting an error with Net/SSLeay.pm - I am trying to POST XML via HTTPS web service

I am trying to use Net/SSLeay.pm in Perl, code says use Net::SSLeay
Error message says the following -
Can't locate Net/SSLeay.pm in #INC (#INC contains: C:/Perl/site/lib C:/Perl/lib .) at test.pl line 7.
BEGIN failed--compilation aborted at test.pl line 7.
I installed SSLeay.pm via Perl Package Manager and verified it -
Crypt-SSLeay
OpenSSL support for LWP
Version: 0.57
Released: 2008-05-02
Author: David Landgren
CPAN: http://search.cpan.org/dist/Crypt-SSLeay-0.57/
Installed files:
C:/Perl/lib/Crypt/SSLeay.pm
C:/Perl/lib/Crypt/SSLeay/CTX.pm
C:/Perl/lib/Crypt/SSLeay/Conn.pm
C:/Perl/lib/Crypt/SSLeay/Err.pm
C:/Perl/lib/Crypt/SSLeay/MainContext.pm
C:/Perl/lib/Crypt/SSLeay/X509.pm
C:/Perl/lib/Net/SSL.pm
C:/Perl/lib/auto/Crypt/SSLeay/.packlist
C:/Perl/lib/auto/Crypt/SSLeay/SSLeay.bs
C:/Perl/lib/auto/Crypt/SSLeay/SSLeay.dll
C:/Perl/lib/auto/Crypt/SSLeay/SSLeay.exp
C:/Perl/lib/auto/Crypt/SSLeay/SSLeay.lib
I am unsure as to why my script does not find it, any help would be appreciated.
Crypt-SSLeay and Net-SSLeay are two different CPAN distributions. If you want to use Net::SSLeay, install "Net-SSLeay" ppm distribution.