Getopt::Long - Extended processing of command line options
use Getopt::Long;
my $data = "file.dat";my $length = 24;my $verbose;GetOptions ("length=i" => \$length, # numeric "file=s" => \$data, # string "verbose" => \$verbose) # flagor die("Error in command line arguments\n");DESCRIPTION
The Getopt::Long module implements an extended getopt function called GetOptions(). It parses the command line from @ARGV, recognizing and removing specified options and their possible values.
my $verbose = ''; # option variable with default value (false)
my $all = ''; # option variable with default value (false)GetOptions ('verbose' => \$verbose, 'all' => \$all);The option name as specified to the GetOptions() function is called the option specification. Later we'll see that this specification can contain more than just the option name. The reference to the variable is called the option destination.
The call to GetOptions() parses the command line arguments that are present in @ARGV and sets the option variable to the value 1 if the option did occur on the command line. Otherwise, the option variable is not touched. Setting the option value to true is often called enabling the option.
GetOptions() will return a true value if the command line could be processed successfully. Otherwise, it will write error messages using die() and warn(), and return a false result.
Getopt::Long - Extended processing of command line options的更多相关文章
- getopt--parse command line options
getopt解析命令行选项 getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - Parse command- ...
- IAR Build from the command line 环境变量设置
http://supp.iar.com/Support/?Note=47884 Technical Note 47884 Build from the command line The alterna ...
- An annotation based command line parser
Java命令行选项解析之Commons-CLI & Args4J & JCommander http://rensanning.iteye.com/blog/2161201 JComm ...
- List of Chromium Command Line Switches(命令行开关集)——官方指定命令行更新网址
转自:http://peter.sh/experiments/chromium-command-line-switches/ There are lots of command lines which ...
- Cookies with curl the command line tool
w https://curl.haxx.se/docs/http-cookies.html curl has a full cookie "engine" built in. If ...
- Linux command line exercises for NGS data processing
by Umer Zeeshan Ijaz The purpose of this tutorial is to introduce students to the frequently used to ...
- C++: Command Line Processing
Save this code here for studying and using it. Surce code is here. CmdLine.h File #pragma once #incl ...
- [笔记]The Linux command line
Notes on The Linux Command Line (by W. E. Shotts Jr.) edited by Gopher 感觉博客园是不是搞了什么CSS在里头--在博客园显示效果挺 ...
- Yandex Big Data Essentials Week1 Unix Command Line Interface Processes managing
free displays the total amount of free and used memory free [options] top provides a dynamic real-ti ...
随机推荐
- 我的python笔记05
Python 之路 Day5 - 常用模块学习 本节大纲: 模块介绍 time &datetime模块 random os sys shutil json & picle shelve ...
- Python里的Flask开发环境的搭建
在已经安装好了Python后,我这里用的是Python3.5,准备进一步学习Flask框架,下面记录搭建Flask环境 这里使用了虚拟环境,在虚拟环境里,最小化的安装Flask. 参考步骤: 1.首先 ...
- Web服务器项目详解 - 00 项目概述
目录 00 项目概述 01 线程同步机制包装类 02 半同步/半反应堆线程池(上) 03 半同步/半反应堆线程池(下) 04 http连接处理(上) 05 http连接处理(中) 06 http连接处 ...
- 最短路(Dijkstra,Floyd,Bellman_Ford,SPFA)
当然,这篇文章是借鉴大佬的... 最短路算法大约来说就是有4种——Dijkstra,Floyd,Bellman_Ford,SPFA 接下来,就可以一一看一下... 1.Dijkstra(权值非负,适用 ...
- 在电脑上用chrome浏览器调试android手机里的网页代码时,无法看到本地加载的js文件
在需要调试的js文件最顶部加上代码就可以看到了: console.log('haha'); debugger;
- 十分钟理解JavaScript引擎的执行机制
关注专栏写文章 十分钟理解JavaScript引擎的执行机制 方伟景 千锋前端开发推动市场提升的学习研究者. 4 人赞同了该文章 首先,请牢记2点: JS是单线程语言 JS的Event Loop是JS ...
- Django_RESTful API
https://q1mi.github.io/Django-REST-framework-documentation/ 1. DRF(Django REST framework) 序列化的类 2. 解 ...
- oracle 处理锁表,创建新的数据库实例
select saddr,sid,serial#,paddr,username,status from v$session where username is not null and usernam ...
- 注解 - @Deprecated
意思是说此方法已过时,过时的原因就是有新的API的类替代了次方法. 这个被划去的方法仍然是可以正常使用的,就是一个提示而已. Java内在的File类中有如下方法 @Deprecated public ...
- IntelliJ IDEA常规配置教程
IntelliJ IDEA,是java编程语言开发的集成环境.IntelliJ在业界被公认为最好的java开发工具,尤其在智能代码助手.代码自动提示.重构.J2EE支持.各类版本工具(git.sv ...