【问题标题】:Getopt::Long::Descriptive - Error in option spec:Getopt::Long::Descriptive - 选项规范中的错误:
【发布时间】:2013-09-25 09:20:58
【问题描述】:

我是使用 perl 编写用法语句的新手,但遇到了一些错误。 请参阅下面粘贴的错误消息。 我的脚本的开头粘贴在下面。

如果您发现任何语法错误或我做错了什么,请告诉我。

谢谢

$ perl make_keggTable.pl -i ko2genes.pau
Error in option spec: "input file|i=s"

$ perl make_keggTable.pl --help
Error in option spec: "input file|i=s" 

use strict;
use warnings;
use Data::Dumper;
use Getopt::Long::Descriptive;
#use Getopt::Long;
#use Pod::Usage;

## usage and help info
my ( $opt, $usage ) = describe_options(
'make_keggTable.pl %o',
  [ 'input file|i=s', 'file of NCBI locus IDS to Kegg KOs' ],
  [ 'OrgCode|o=s', 'kegg organism code(Pseu.PA14=pau,   Pseu.PA01=pae,Salm.14028S=seo,Salm.LT2=stm,Ecoli.MG1655=eco)'],
  [],
  [ 'verbose|v', 'print with verbosity' ],
  [ 'help',      'print usage message and exit' ],
);

if ($opt->help) {
 print $usage->text, "\n";
}

【问题讨论】:

    标签: perl


    【解决方案1】:

    由于 perl 和Getopt::Long 遵循 Unix 的选项语法标准,选项名称不能包含空格。去掉input file之间的空格就可以编译了。

    【讨论】:

      猜你喜欢
      • 2015-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-27
      相关资源
      最近更新 更多