mse*_*ery 2 perl warnings eval
我收到这个警告:
Use of uninitialized value in eval \"string\" at myscript.pl line 57.
Run Code Online (Sandbox Code Playgroud)
当我运行此代码时:
eval;
{
`$client -f $confFile -i $inputFile -o $outputFile`;
};
if( $@ )
{
# error handling here ...
}
Run Code Online (Sandbox Code Playgroud)
是什么导致错误?
我该如何解决根本原因?(或以其他方式压制警告?)
Leo*_*ans 12
无论如何,这里的评估绝对没有任何意义.反引号永远不会抛出错误.这不是$@
,但是$?
,你要检查.
此外,如果您丢弃结果,使用系统可能是一个更清洁的想法.例如
system($client, '-f', $confFile, '-i', $inputFile, '-o', $outputFile) and do {
#error handling here...
};
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
843 次 |
最近记录: |