为什么我的脚本报告中的eval‘串’“未初始化值?
题
我收到这样的警告:
Use of uninitialized value in eval \"string\" at myscript.pl line 57.
当运行此代码:
eval;
{
`$client -f $confFile -i $inputFile -o $outputFile`;
};
if( $@ )
{
# error handling here ...
}
什么导致错误?
如何解决的根本原因是什么? (或者以其他方式抑制警告?)
解决方案
有后是eval
其他提示
这里的EVAL将反正什么都不做。反引号不会抛出错误。这不是$@
但$?
要检查。
另外,如果你把自己的结果,也可能是使用清洁理念系统。 e.g。
system($client, '-f', $confFile, '-i', $inputFile, '-o', $outputFile) and do {
#error handling here...
};
不隶属于 StackOverflow