foomatic-configure 产生奇怪的 Perl 警告

foomatic-configure 产生奇怪的 Perl 警告

我正在使用 CentOS 6.4 并尝试使用“foomatic-configure”来打印信息,但收到一些奇怪的错误:

Perl:v5.10.1

foomatic:foomatic-4.0.4-1.el6_1.1.i686

命令行:

foomatic-configure -r -P -q

产生这些警告:

Use of uninitialized value $manufacturer in string eq at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 354.
Use of uninitialized value $model in string eq at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 355.
Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 2147.
Use of uninitialized value $d in hash element at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1143.
Use of uninitialized value in regexp compilation at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1146.
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1146.
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1189.
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1191.
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1193.
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1195.
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1197.
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1199.
Use of uninitialized value in hash element at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1249.

尤克,这是怎么回事???

我确实收到了包含正确数据的 perl 哈希值$QUEUES[0],但可以没有错误消息......

更新:

看起来我可以使用以下命令来抑制这些消息:

foomatic-configure -P -q -r 2>/dev/null

但不应该这样做......

答案1

guessmake()前两个警告出现在的函数中Foomatic::DB。查看代码路径,$manufacturer$model始终是未定义的,因此eq在这里进行比较没有意义,但除了噪音之外,它们是无害的。我没有看其他警告。

“修复”此问题的最简单方法是-w从 的 shebang 中删除该选项foomatic-configure,以便禁用所有警告。但最好给维护人员写一份错误报告。

相关内容