#!/usr/bin/perl
use strict "vars";
use warnings;
use feature qw(switch);
use locale;
use POSIX qw(locale_h);
setlocale(LC_ALL, "cs_CZ.UTF-8");
use constant (
ERROR_OK => 0,
ERROR_CMD => 1,
ERROR_INPUT => 2,
ERROR_OUTPUT => 3,
ERROR_INPUT_FORMAT => 4
);
exit ERROR_OUTPUT;
Run Code Online (Sandbox Code Playgroud)
我仍然收到错误"参数"ERROR_OUTPUT"在退出时不是数字..."我怎样才能使用常量来表示退出值而不是直接使用数字?
cho*_*oba 12
更改后的括号use constant到curlies.
use constant {
ERROR_OK => 0,
# etc.
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
204 次 |
| 最近记录: |