Perl foot This newspaper can ' t locate mail/sender.pm solution

Source: Internet
Author: User
Tags mail thread perl script linux

After a Perl script that configures disk space alarms on the new Linux server (Red Hat Enterprise linux Server Release 5.7 (tikanga)), the test times follows the following error

[Oracle@db-server scripts]$./disk_capatiy_alarm.sh

Can ' t locate mail/sender.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/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/home/oracle/scripts/output/disk_sendmail.pl Line 2.

BEGIN failed--compilation aborted at/home/oracle/scripts/output/disk_sendmail.pl line 2.

The Perl script disk_sendmail.pl as follows, which uses the Mail-sender mail module,

#!/usr/bin/perl use
mail::sender;
$sender = new Mail::sender {smtp => ' xxx.xxx.xxx.xxx ', from => ' xxx@xxx.com '};
$sender->mailfile ({to => ' xxx@xxx.com ',
cc=> ' xxx@xxx.com ', subject => ' The
server xxxx\ ' s Disk Capacity Alarm ',
msg => ' Dear all, the
   server xxxx disk Capacity Alarm, please take action for it. Many thanks!
',
file => '/home/oracle/scripts/output/diskdetail.txt '});

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/extra/

This error occurs because Perl does not have the Mail-sender module installed, the problem of installing this module is resolved, and the Mail::sender module supports sending messages with attachments. There are several ways to install

1: Use CPAN installation, require the server to access the extranet, otherwise can not download the related package.

Cpan> Install Mail::sender
2: Download perl-mail-sender-0.8.16-1.el5.pp.noarch.rpm

Download Address: http://rpm.pbone.net/index.php3/stat/4/idpl/10370607/dir/redhat_el_5/com/ Perl-mail-sender-0.8.16-1.el5.pp.noarch.rpm.html

[Root@db-server oracle]# RPM-IVH perl-mail-sender-0.8.16-1.el5.pp.noarch.rpm

Warning:perl-mail-sender-0.8.16-1.el5.pp.noarch.rpm:header V3 DSA Signature:nokey, key ID 6971f6ac

Preparing ... ########################################### [100%]

1:perl-mail-sender ########################################### [100%]

3: Download and install mail-sender-0.8.16.tar.gz. I have not experimented with this method because http://search.cpan.org/CPAN/authors/id/J/JE/JENDA/Mail-Sender-0.8.16.tar.gz is always unable to download the installation package.

Author: The Hermit of Xiaoxiang

Source: http://www.cnblogs.com/kerrycode/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.