返回错误代码(Returning Error Code)
是否可以从perl脚本返回错误代码?
我正在编写带有参数KEY的perl脚本,
现在要掩盖负面情况,比如文件打开失败密钥已存在等,
我想返回不同的错误代码,例如enum {FILE_OPEN_FAILED,DUPLICATE_KEY}
这个perl脚本是从C函数调用的,并且根据我需要生成ALARMS的错误代码。
请帮忙...
谢谢,V-Anu
Is it possible to return an error code from a perl script?
I am writing perl script which takes a parameter KEY,
Now to cover up negative scenario, like file open failure Key already exist etc,
I want to return different error code, like enum { FILE_OPEN_FAILED, DUPLICATE_KEY }
This perl script is called from a C function and depending on the error code I need to generate ALARMS.
Please Help...
Thanks, V-Anu
原文:https://stackoverflow.com/questions/6502580