我收到这样的警告:

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...
};
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top