Is version.pm available in CPAN any longer? - perl

I am trying to find the Perl Module version.pm to fix the error below I am receiving while trying to install module CPAN-Meta-Requirements-2.133. But I don't see version.pm, the only one I see is Version.PM which is obviously not the one Perl is looking for. Can anyone point to where I can get this version or how I can fix this dependency if version.pm is no longer available?
Perl Version:
v5.16.3
OS:
GNU/Linux
x86_64 x86_64 x86_64
Error:
Can't locate version.pm in #INC (#INC contains: # Line breaks added
/root/CPAN-Meta-Requirements-2.133/blib/lib # for readability
/root/CPAN-Meta-Requirements-2.133/blib/arch
/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 1) line 2.
BEGIN failed--compilation aborted at (eval 1) line 2.
BEGIN failed--compilation aborted at /root/CPAN-Meta-Requirements-2.133/blib/lib/CPAN/Meta/Requirements.pm line 48.
Compilation failed in require at t/accepts.t line 4.
BEGIN failed--compilation aborted at t/accepts.t line 4.
t/accepts.t ............ Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run

version has come with Perl since Perl 5.10, so it's weird that you would have to install it.
$ corelist version
version was first released with perl v5.9.0
But version is also available on CPAN in its own distribution in order to allow people to upgrade version without upgrading Perl.
So you may indeed install it as any other module.
cpan version

OK, so first: your link is to CPAN/Version.pm. This is very different than version.pm. Directory names and the path relative to Perl's include directory are very important to Perl, and putting a .pm file in the wrong location relative to the include path can break Perl pretty badly.
Second: because of that, never install Perl modules manually. Use cpanm instead:
curl -L https://cpanmin.us | perl - --sudo App::cpanminus # Omit --sudo if your perl isn't installed as root
cpanm version
Third: the version.pm that you want is this one: https://metacpan.org/pod/distribution/version/lib/version.pod, in the JPEACOCK/version-0.9912 distribution.

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

Installing Perl Module in specified directory

I am trying to install one of the Perl module in my server (ubuntu droplet from Digital Ocean). I wanted this module to be installed in /home/vinod/my_test_folder/perl_practice/scripts/lib/ directory which I have already created.
This is specific to one module. I don't want to install it in default path like /usr/bin/perl. I wanted it to be installed in above mentioned path.
Here are the list of commands which I executed to install the Email::Reply perl module.
Downloaded module from metacpan
tar xvfz Email-Reply-1.204.tar.gz
cd Email-Reply-1.204/
perl Makefile.PL PREFIX=/home/vinod/my_test_folder/perl_practice/scripts/lib/
su
<password_for_root>
make
make test
make install
When I execute make install command the following output got displayed on terminal screen
Manifying 1 pod document
Installing /home/vinod/my_test_folder/perl_practice/scripts/lib/share/perl/5.26.1/Email/Reply.pm
Installing /home/vinod/my_test_folder/perl_practice/scripts/lib/man/man3/Email::Reply.3pm
Appending installation info to /home/vinod/my_test_folder/perl_practice/scripts/lib//lib/x86_64-linux-gnu/perl/5.26.1/perllocal.pod
And I could see the module got installed in /home/vinod/my_test_folder/perl_practice/scripts/lib/share/perl/5.26.1/Email/Reply.pm path, which is not right path which I mentioned in PREFIX=.
Strange thing here I wrote one small script which uses Email::Reply module by mentioning module path in shebang line
Code below:
#!/usr/bin/perl -I/home/vinod/my_test_folder/perl_practice/scripts/lib/share/perl/5.26.1/
use EMail::Reply;
print "Hi\n";
still its throws an error
Can't locate EMail/Reply.pm in #INC (you may need to install the EMail::Reply module) (#INC contains: /home/vinod/my_test_folder/perl_practice/scripts/lib/share/perl/5.26.1/ /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at test.pl line 3.
BEGIN failed--compilation aborted at test.pl line 3.
I want this module to be installed in /home/vinod/my_test_folder/perl_practice/scripts/lib/
How to achieve this. Please help me.
This is what local::lib can be used for, and cpanm supports it by default:
$ cpanm -l /home/vinod/my_test_folder/perl_practice/scripts Email::Reply
This will install it to /home/vinod/my_test_folder/perl_practice/scripts/lib/perl5.
Alternatively you can recreate the options local::lib sets for this case, the important one for this case is PERL_MM_OPT.
$ env PERL_MM_OPT='INSTALL_BASE=/home/vinod/my_test_folder/perl_practice/scripts' cpanm Email::Reply
Importantly, note that all of this is case sensitive, you must use Email::Reply;.

Bugzilla 5.0 install on OpenShift - Can't locate parent.pm in #INC

Attempting to install Bugzilla on an OpenShift small gear. Using SSH to wget 5.0 tarball, untar-ing and running the checksetup.pl --check-modules script gives me this error:
Can't locate parent.pm in #INC (INC contains: . lib /var/openshift/[app-id]/app-root
/runtime/repo/libs /var/lib/openshift/[app-id]/perl/perl5lib/lib/perl5 /usr/local/lib64
/perl5 /usr/local/share/perl5 /usr/lib/lib64/perl5/vendor-perl /usr/share/perl5/vendor-perl
/usr/lib64/perl5 usr/share/perl5) at Bugzilla/Constants.pm line 14.
BEGIN failed--compilation aborted at Bugzilla/Constants.pm line 14.
Compilation failed in require at ./checksetup.pl line 27.
BEGIN failed--compilation aborted at ./checksetup.pl line 27.
Line 14 of Bugzilla/Constants.pm: `use parent qw(Exporter);`
Line 27 of ./checksetup.pl: `use Bugzilla::Constants;`
[app-id] in the paths is just a random string of hex digits used to identify an OpenShift application.
All help would be greatly appreciated. Thanks in advance!
That means either parent is not installed in your system or it's not a part of #INC.
Try perldoc -l parent to see if it's installed or not.
If it's installed then update PERL5LIB enviroment variable to add path to directory where module is installed.
If it's not installed then run cpan parent to install.
Also see:
How do I 'use' a Perl module in a directory not in #INC?
How to change #INC to find Perl modules in non-standard locations
Apparantly OpenShift has a cpan.txt file in the .openshift folder. Adding parent to that folder installed the required module.
#please install above packages:
[root#rsync ~]# yum install perl-parent -y

Linux, Backtrack, Perl, Bluesniff

I am trying to run bluesniff on backtrack.I have the bluesniff.pl script and when i try to execute it by typing:
perl bluesniff.pl
An error message came out:
Can't locate Curses.pm in #INC (#INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/local/share/perl/5.10.1/Curses/Application.pm line 92.
BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Curses/Application.pm line 92.
Compilation failed in require at bluesniff.pl line 23.
BEGIN failed--compilation aborted at bluesniff.pl line 23.
Please advise!
To all who commented, thanks! It worked.
Run
cpan Curses
from the command line to install this module and all dependencies.
You need to download the Curses Perl module.
You can install Curses simply by typing apt-get install libcurses-ui-perl if you don't need to learn and install all the Perl stack. If you prefer to, do as others said and use Cpanm to install it.

Why does Perl say that it can't find my module?

I wanted to play with XML::Rabbit, however I've got a problem even with the simplest code. I managed to strip this into one line.
In a simple file, I use
use Class::Load;
and then:
perl test_optlist.pl
Can't locate Data/OptList.pm in #INC (you may need to install the Data::OptList module) (#INC contains: [CUT]) at /home/szymon/perl5/lib/perl5/Class/Load.pm line 8.
BEGIN failed--compilation aborted at /home/szymon/perl5/lib/perl5/Class/Load.pm line 8.
Compilation failed in require at test_optlist.pl line 2.
BEGIN failed--compilation aborted at test_optlist.pl line 2.
so let's install it:
$ cpanm Data::OptList
Data::OptList is up to date. (0.107)
Perl version:
This is perl 5, version 17, subversion 8 (v5.17.8) built for x86_64-linux
Where is the problem?
You're surely using another perl's cpanm. Do
perlbrew install-cpanm
to install a version of cpanm under perlbrew's control, make sure this new cpanm is the one found first in the path (though I suspect it will be), then try again