【发布时间】:2016-02-08 17:15:08
【问题描述】:
测试 Getopt::Long perl,当使用参数执行时,选项打印命令输出是 1,而不是提供的参数。
这是代码..找不到这里缺少的东西。
#!c:\Perl\bin
use Getopt::Long;
(@ARGV) or die "$0 --file <file name> --cb <CBEntry>";
GetOptions( "file" => \$file,
"cb" => \$cb) or die "$0 --file <file name> --cb <CBEntry> :$! \n";
#print @ARGV;
print $file;
print $cb;
【问题讨论】:
-
参见documentation中的“带值的选项”。
标签: perl options getopt-long