mysql - Perl 脚本无法在 @INC 中找到 Text/Template.pm

标签 mysql perl

我正在尝试调整用 Perl 编写的 MySQL 调谐器脚本。但出现以下错误:

root@server2 [/tmp]# perl mysqltuner.pl
Can't locate Text/Template.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 mysqltuner.pl line 2816.
BEGIN failed--compilation aborted at mysqltuner.pl line 2816 (#1)
    (F) You said to do (or require, or use) a file that couldn't be
    found. Perl looks for the file in all the locations mentioned in @INC,
    unless the file name included the full path to the file.  Perhaps you
    need to set the PERL5LIB or PERL5OPT environment variable to say where
    the extra library is, or maybe the script needs to add the library name
    to @INC.  Or maybe you just misspelled the name of the file.  See
    perlfunc/require and lib.

Uncaught exception from user code:
        Can't locate Text/Template.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 mysqltuner.pl line 2816.
BEGIN failed--compilation aborted at mysqltuner.pl line 2816.
 at mysqltuner.pl line 2816

很高兴为此提供解决方案。

最佳答案

在您的 Perl 脚本 mysqltuner.pl 中,您正在使用模块 Text::Template您的系统中未安装该软件,这就是您收到此警告的原因。 您可以使用 cpan 安装它。如果您使用的是 Linux 系统,请打开终端并输入:

sudo cpan install Text::Template #sudo is not required if you have login as root.

如果您使用的是 Windows 系统并使用 ActivePerl,请使用:

ppm install Text-Template

关于mysql - Perl 脚本无法在 @INC 中找到 Text/Template.pm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33821544/

相关文章:

mysql - 简单的 MySQL 查询需要两个多小时

mysql - 按月分组并返回结果为 0 的月份按年过滤

Git 提交 Hook - 如何使用 commit-msg Hook 检查消息中的字符串?

oop - 什么是间接对象表示法,为什么不好,如何避免呢?

perl - 为什么这个使用 wget 保存 youtube 视频的 perl 脚本不能正常工作?

perl - 为什么在我的代码生成程序中出现此语法错误?

PHP Excel导出仅显示MYsql表的最后一行

mysql - concat() 在 squirrel sql 中以十六进制格式显示为 varbinary 而不是纯文本

perl - 我们可以在 perl 脚本中创建 bash 实例吗?

MySQL批处理和连接: is it possible using SQL file injection?