Perl 脚本传参
Perl 腳本傳參
使用perl自帶的Long.pm模塊 use Getopt::Long; Getopt::Long::GetOptions( 'c=s' => $community, //c是傳遞的參數標識符,s代表傳遞的參數是字符串,參數將傳遞給$community這個變量 'H=s' => $host_name, 'v=i' => $version, //i代表傳遞的參數是數字 ); use Getopt::Long; if (!GetOptions( "-defopts=s" => \$defoptis, "-cmpopts=s" => \$cmpopts, "-simopts=s" => \$simopts, ) or $help) { die $usage; }
總結
- 上一篇: 线性时间选择问题
- 下一篇: angelica类似_亲爱的当归(Ang