我正在用开放的suse操作系统通过komodo ide编写perl代码。
我在命令行中通过:
--verbose --verbose -v --more --lib='/lib' -l '/lib64' -f a=1 --flag b=2 --debug 2 -t fukai
具有以下代码的脚本:
use Getopt::Long;
use Smart::Comments;
my @libs = ();
my %flags = ();
my ($verbose, $all, $more, $diam, $debug, $test, $step);
GetOptions(
'verbose+' => \$verbose,
'more!' => \$more,
'debug:i' => \$debug,
'lib=s' => \@libs,
'flag=s' => \%flags,
'test|t' => \$test,
'all|everything|universe' => $all
);
### $verbose
### $more
### $debug
### $test
### @libs;
### %flags
我收到错误消息:
Undefined argument in option spec
答案 0 :(得分:2)
'all|everything|universe' => $all
应该是
'all|everything|universe' => \$all