如何创建Perl脚本以获取一些“命名”命令行参数?

栏目: Perl · 发布时间: 7年前

内容简介:使用翻译自:https://stackoverflow.com/questions/2230483/how-can-i-create-a-perl-script-to-get-some-named-command-line-arguments

如何创建 Perl 脚本以获取一些“命名”命令行参数?

例如:

perl my_perl.pl -ARG_1 1234 -ARG_2 "Testing"

其中ARG_1和ARG_2是参数名称,1234和“测试”它们的值.

使用 Getopt::Long 可以获得类似的效果.主要区别在于它默认使用gnu-style –arguments.它非常灵活和强大.

翻译自:https://stackoverflow.com/questions/2230483/how-can-i-create-a-perl-script-to-get-some-named-command-line-arguments


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

Pro Git (Second Edition)

Pro Git (Second Edition)

Scott Chacon、Ben Straub / Apress / 2014-11-9 / USD 59.99

Scott Chacon is a cofounder and the CIO of GitHub and is also the maintainer of the Git homepage ( git-scm.com ) . Scott has presented at dozens of conferences around the world on Git, GitHub and the ......一起来看看 《Pro Git (Second Edition)》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具