[oracle@testdb88 ~]$ ~/perl/mailTableSpaceSize.pl bypass
Can't locate Mail/Sendmail.pm in @INC (@INC contains: /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 /home/oracle/perl/mailTableSpaceSize.pl line 6.
BEGIN failed--compilation aborted at /home/oracle/perl/mailTableSpaceSize.pl line 6.
Perl腳本mailTableSpaceSize.pl如下所示,其中使用了Mail::Sendmail郵件模塊。
#!/usr/bin/perl
use DBI;
use Mail::Sendmail;
use MIME::QuotedPrint;
use MIME::Base64;
use Encode;
use Number::Format qw(:subs);
use DateTime qw();
出現這個錯誤是因為Perl沒有安裝Mail::Sendmail模組,安裝此模組問題即可解決,可以使用下面幾種方式安裝。 (使用cpan安裝,Server要能夠連上網路,否則無法下載相關package。
[Best]
CPAN shellperl -MCPAN -e shell
install Mail::Sendmail
cpanm
cpanm Mail::Sendmail
[Traditional]
perl Makefile.PLmake
make test
make install
[Manual]
Copy Sendmail.pm to Mail/ in your Perl lib directory.參考資訊:
Neil Bowers / Mail-Sendmail-0.80 ++ / Mail::Sendmailhttps://metacpan.org/pod/Mail::Sendmail
How to install CPAN modules
https://www.cpan.org/modules/INSTALL.html
Perl 教程
https://www.runoob.com/perl/perl-tutorial.html
沒有留言:
張貼留言