Bioperl library installation in mysql server - perl

I installed Bioperl and works correctly.
then installed Bio::Tools::Run::Phylo::Phyml and it works good from terminal.
But when I call same script contains it from a browser to using CGI method, I get this error:
Can't locate Bio/Tools/Run/Phylo/Phyml.pm in #INC (#INC contains:
/etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14
/usr/share/perl/5.14 /usr/local/lib/site_perl . /etc/apache2) at
/var/www/Adol/mafToPhyML1.pl line 14.\nBEGIN failed--compilation
aborted at /var/www/Adol/mafToPhyML1.pl line 14.
I got this message from error.log

This post is similar to your question. You need to properly set #INC in your cgi script. Add a use lib pragma to your cgi script with the directory that contains the Bio directory of where your Phyml.pm is located.

Related

Read error while reading data form Excel spreadsheet by using Perl

What is this error? When I am trying to read data from Excel using Perl?
Can't locate Spreadsheet/Read.pm in #INC (#INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at read_data.pl line 4. BEGIN failed--compilation aborted at read_data.pl line 4.
It means Spreadsheet::Read module is not install in your system where you are executing your Perl script. Install that module.

Perl, Can't locate Packet/UDP/Syslog.pm in #INC | custom modules

Anybody please can spot a mistake here? I do have one perl script and 3 custom perl modules. I specified location of the modules using export, also using -I, also inside the script using:
use lib '/var/pwn/syslog-generator/perl-modules/';
but script still fails with common error:
Can't locate Packet/UDP/Syslog.pm in #INC (#INC contains: /var/pwn/syslog-generator/perl-modules/ ./ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at raw-syslog.pl line 5.
BEGIN failed--compilation aborted at raw-syslog.pl line 5.
modules are located here:
ls /var/pwn/syslog-generator/perl-modules
Packet.pm Syslog.pm UDP.pm
perl -V
Compiled at Sep 30 2013 03:45:34
%ENV:
PERL5LIB=":/var/pwn/syslog-generator/perl-modules/"
#INC:
/var/pwn/syslog-generator/perl-modules/
/etc/perl
/usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.14
/usr/share/perl/5.14
/usr/local/lib/site_perl
And my perl script starts like this:
#!/usr/bin/perl
use strict; use warnings;
use lib './';
use lib '/var/pwn/syslog-generator/perl-modules/';
use Packet::UDP::Syslog;
use POSIX qw/strftime/;
I also tryed to start the script with -Idirectory [specify #INC/#include directory], but:
perl -I /var/pwn/syslog-generator/perl-modules raw-syslog.pl
Can't locate Packet/UDP/Syslog.pm in #INC (#INC contains: /var/pwn/syslog-generator/perl-modules/ ./ /var/pwn/syslog-generator/perl-modules /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at raw-syslog.pl line 5.
BEGIN failed--compilation aborted at raw-syslog.pl line 5.
again, no luck. Something obvious I am missing?
Thank you
Do you have 3 modules in 3 files called Packet.pm, Syslog.pm, and UDP.pm?
Do they have package Packet; , package Syslog; and package UDP; respectively at their top?
If so, you need to load each one of them separately using
use Packet;
use Syslog;
use UDP;
On the other hand, if you have one file in Packet/Syslog/UDP.pm then it has to have
package Packet::Syslog::UDP; at the top and you'd load it using
use Packet::Syslog::UDP;
Oh, and BTW, if this is up to you, I'd strongly recommend using a company or project specific module name-space. So instead of 'Packet.pm' I'd create a file called 'Company/Packet.pm' which would have package Company::Packet; at the top and I'd load it with use Company::Packet; Otherwise you'll easily bump into modules with the same name.
Some articles that might shed more light on the subject:
How to create a Perl Module for code reuse?
Packages, modules, distributions, and namespaces in Perl
(disclaimer: articles written by myself)
When you use Packet::UDP::Syslog, Perl will mangle that name to the path Packet/UDP/Syslog.pm. It will then loop through the #INC directories and look for matches:
/var/pwn/syslog-generator/perl-modules/Packet/UDP/Syslog.pm
/etc/perl/Packet/UDP/Syslog.pm
/usr/local/lib/perl/5.14.2/Packet/UDP/Syslog.pm
/usr/local/share/perl/5.14.2/Packet/UDP/Syslog.pm
/usr/lib/perl5/Packet/UDP/Syslog.pm
/usr/share/perl5/Packet/UDP/Syslog.pm
/usr/lib/perl/5.14/Packet/UDP/Syslog.pm
/usr/share/perl/5.14/Packet/UDP/Syslog.pm
/usr/local/lib/site_perl/Packet/UDP/Syslog.pm
./Packet/UDP/Syslog.pm
If none of those files exists, the module hasn't been found. However, you only have these files:
/var/pwn/syslog-generator/perl-modules/Packet.pm
/var/pwn/syslog-generator/perl-modules/Syslog.pm
/var/pwn/syslog-generator/perl-modules/UDP.pm
That's not correct because the file system hierarchy is relevant when resolving namespaces. I suggest you properly install your module rather than copying files into a directory. You can use cpan or cpanm to install the module, and can use local::lib to install to a custom module location.

Perl module not found

while I try to import a perl module into my script it says perl module not found.
#!/usr/bin/env perl
use lib 'mnt/hgfs/scripting/perl/perlib/Array';
use Shell;
#define all global variables here
use List::MoreUtils 'first_index';
use List::MoreUtils 'last_index';
use Getopt::Long;
use vars qw(%vectorList);
use Array::Compare;
I am getting the following error-
Can't locate Array/Compare.pm in #INC (#INC contains: mnt/hgfs/scripting/perl/perlib/Array /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 wellbiasing.pl line 12.
BEGIN failed--compilation aborted at wellbiasing.pl line 12.
even though i have installed the Array module in perlib directory it says the module is not found.Array is a directory inside perlib directory which i had created to put all the modules inside the Array directory there is Compare.pm. but why is that I am not able to run it?
Change:
use lib 'mnt/hgfs/scripting/perl/perlib/Array';
to:
use lib 'mnt/hgfs/scripting/perl/perlib';
The Array directory should not be part of the Perl module search path.

Whats does the Perl error "Can't locate Net/SSH/Perl.pm" mean?

I am running a perl script that uses SSH, but it prints the following error:
Can't locate Net/SSH/Perl.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 newone.pl line 3. BEGIN
failed--compilation aborted at newone.pl line 3.
Perl can't seem to locate Net/SSH/Perl.pm. Why can't it find it and how do I install it?
Your code is fine, although I haven't checked it as the error is due to a missing perl module.
What's the easiest way to install a missing Perl module?
You need to install and/or include the appropriate SSH library for perl. You can install it using this command:
cpan install Net::SSH::Perl

Can't locate RPC/XML.pm Perl and RPC XML

I'm getting this error message when trying to to use the RPC XML with Perl.
Software error:
Can't locate RPC/XML.pm in #INC (#INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /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 9.
BEGIN failed--compilation aborted at test.pl line 9.
For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.
First I thought I didn't have XML-RPX installed. But when I look into a phpinfo()-file I find this:
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
How come this error shows up? It looks to me as it is installed and PHP "finds it". But not Perl.
PHP having an xmlrpc config is no indication that the RPC::XML Perl module is installed, and the error message strongly suggests that it isn't (If it is, then it is outside the Perl library paths).
You need to install the RPC::XML module.