perl usage()和getopt

#!/usr/bin/perl
#perl search.pl --infile Targets.Lung.Carcinoma.genelist.txt --homogene Homo_sapiens.gene_info --outfile Targets.Lung.Carcinoma.geneID.txt
use warnings;
use strict;
use Getopt::Long;


my ($infile,$homogene,$outfile);
GetOptions('infile=s'=>\$infile,'homogene=s'=>\$homogene,'outfile=s'=>\$outfile,"help|h" =>\&USAGE,)or USAGE();

 

sub USAGE {
my $usage=<<"USAGE";
USAGE:
$0
--infile input filefiel

--homogene Homo_sapiens.gene_info

--outfile output file

USAGE
print $usage;
exit;
}

posted @ 2017-02-09 13:59  nkwy2012  阅读(1278)  评论(0)    收藏  举报