I want to send an email using perl Email module. I have installed Email::Sender. After running the following
sudo perl -MCPAN -e shell
install Email::Sender
and it says Email::Sender is up to date.
But when I run my script I get the following error:
Can't locate Email/Sender/simple.pm in #INC (#INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./first.pl line 8.
BEGIN failed--compilation aborted at ./first.pl line 8.
Script:
use Email::Sender::simple qw(sendmail); #line 8
use Email::Simple; #line 9
Any help appreciated.
The module is called Email::Sender::Simple (with two capital S characters), not Email::Sender::simple
Although in perl-CPANEL shows the library installed correctly, it doesn't work, you can try next:
1) install epel repository from rpm (you can find it easy, by searching on google)
2) issue yum repolist
3) issue yum install perl-Mail-Sender.noarch
Related
I have unsuccessfully tried to install Perl module in cygwin like in an answer. I have got the following error:
$ perl -MCPAN -e shell
Can't locate CPAN.pm in #INC (you may need to install the CPAN module) (#INC contains: /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/site_perl/5.22 /usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/vendor_perl/5.22 /usr/lib/perl5/5.22/x86_64-cygwin-threads /usr/lib/perl5/5.22 .).
BEGIN failed--compilation aborted.
How can I obtain cpan in my cygwin?
There are some additional details. Actually my purpose was to install ack like in answer. However, it didn't work. After installing I have got an error:
$ ack
Can't locate filetest.pm in #INC (you may need to install the filetest module) (#INC contains: /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/site_perl/5.22 /usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/vendor_perl/5.22 /usr/lib/perl5/5.22/x86_64-cygwin-threads /usr/lib/perl5/5.22 .) at /home/loom/bin/ack line 218.
BEGIN failed--compilation aborted at /home/loom/bin/ack line 218.
The following was my trying to locate cpan
$ cpan
-bash: cpan: command not found
$ ll /usr/lib/perl5/5.22/CPAN.pm
ls: cannot access '/usr/lib/perl5/5.22/CPAN.pm': No such file or directory
$ find /usr/ -name *.pm | grep CPAN
/usr/lib/perl5/5.22/CPAN/Meta/Converter.pm
/usr/lib/perl5/5.22/CPAN/Meta/Feature.pm
/usr/lib/perl5/5.22/CPAN/Meta/History.pm
/usr/lib/perl5/5.22/CPAN/Meta/Merge.pm
/usr/lib/perl5/5.22/CPAN/Meta/Prereqs.pm
/usr/lib/perl5/5.22/CPAN/Meta/Requirements.pm
/usr/lib/perl5/5.22/CPAN/Meta/Spec.pm
/usr/lib/perl5/5.22/CPAN/Meta/Validator.pm
/usr/lib/perl5/5.22/CPAN/Meta/YAML.pm
/usr/lib/perl5/5.22/CPAN/Meta.pm
/usr/lib/perl5/5.22/Parse/CPAN/Meta.pm
Reinstalling perl helped.
$ apt-cyg install perl
I am trying to write a small code but as soon as i am importing "Selenium::Remote::Driver:", i get an error stating
"Can't locate Selenium/Remote/Driver.pm in #INC"
I have tried installing it using below command
sudo apt-get install libtest-www-selenium-perl
still i get same error
$ perl -e 'use Selenium::Remote::Driver;'
Can't locate Selenium/Remote/Driver.pm in #INC (you may need to install the Selenium::Remote::Driver module) (#INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
Selenium::Remote::Driver is not part of Test::WWW::Selenium. From the documentation:
Installation
It's probably easiest to use the cpanm or CPAN
commands: bash $ cpanm Selenium::Remote::Driver
I try to install/update Perl module with cpanm. But, it failed for every modules.
for example:
cpanm Config::General
--> Working on Config::General
Fetching http://www.cpan.org/authors/id/T/TL/TLINDEN/Config-General-2.56.tar.gz ... OK
Configuring Config-General-2.56 ... OK
Building and testing Config-General-2.56 ... OK
Successfully installed Config-General-2.56 (upgraded from 2.52)
1 distribution installed
So, i expect that version of Config::General is now 2.56, but... :
perl -e 'use Config::General 2.56'
Config::General version 2.56 required--this is only version 2.52 at -e line 1.
I try the same logged in superU but same problem...
But now, i have Perl lib in
~/perl5/lib/perl5/ and /usr/lib/perl/5.18/
How can i properly update Perl modules with cpanm?
Some information about my install:
$ perl -E'
say "$_=$ENV{$_}" for qw( PERL_MM_OPT PERL_MB_OPT PERL5LIB );
say "--";
say for #INC;
'
PERL_MM_OPT=INSTALL_BASE=/home/hacklionex/perl5
PERL_MB_OPT=--install_base "/home/hacklionex/perl5"
PERL5LIB=
--
/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
.
Your are instructing the module installers to install modules in /home/hacklionex/perl5 (via PERL_MM_OPT and PERL_MB_OPT), but you don't tell Perl to look for modules there (it's not in #INC). Add the following to your login script:
export PERL5LIB=/home/hacklionex/perl5/lib/perl5
Or add the following to your script:
use lib '/home/hacklionex/perl5/lib/perl5';
I use a Mac OS X 10.8, and want to run the latexindent.pl perl script on my latex files. This script is made by https://github.com/cmhughes/latexindent.plx. When I run this script on a latexfile I get this error message:
Can't locate File/HomeDir.pm in #INC (#INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.4/darwin-thread-multi-2level /Library/Perl/Updates/5.12.4 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at helloworld.pl line 10.
BEGIN failed--compilation aborted at helloworld.pl line 10.
It seems that I am missing the File::HomeDir module in perl so I tried to download it using:
sudo perl -MCPAN -e 'install File::HomeDir',
I get the following error:
Can't locate object method "install" via package "File::HomeDir".
I managed to install the YAML::Tiny package without any problems.
I tried to run:
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use FindBin;
6 use YAML::Tiny;
7 use File::Copy;
8 use File::Basename;
9 use Getopt::Std;
10 use File::HomeDir;
11
12 print "hello world";
13 exit;
and got the same Error message as above...
Do anyone know what to do?
sudo perl -MCPAN -e 'install "File::HomeDir"'
^ ^
I had a similar problem. I just ran these commends, and it worked for me
sudo cpan -i File::HomeDir
then
sudo cpan -i Unicode::GCString
Basically, I will run latexindent file_name.tex, then an error message will appear that says you may need to install the XXXX module then I install the XXXX module using sudo cpan -i XXXX
USER:~/Directory>curl http://www.w3schools.com/html/html_tables.asp | html.parser2.pl
Can't locate HTML/Scrubber.pm in #INC (#INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5 /usr/share/perl5 /usr/lib64/perl5 /usr/share/perl5 /usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl /usr/lib/perl5/site_perl .) at ./html.parser2.pl line 2.
BEGIN failed--compilation aborted at ./html.parser2.pl line 2.
What's happening here?
What's happening is that perl can't find the HTML::Scrubber module, which is required somewhere in the html.parser2.pl script.
Usually, the fix is to install it with cpan
cpan HTML::Scrubber
or possibly one of
sudo cpan HTML::Scrubber
<perl> -MCPAN -e 'install "HTML::Scrubber"'
where <perl> is the full path to the version of perl in the html.parser2.pl script's shebang line.
This solution might not work for a number of reasons (cpan can fail building and installing the module, you have more than one version of perl on your system and you are installing the module in the "wrong" version, ...). If cpan doesn't fix your problem, ask another question here including all the relevant output from the cpan process and from your command line invocation of the script.