perlでコマンドラインオプションの処理方法
- 参考:Perl スクリプトでのコマンドラインオプション処理
- Getopt::Longを使う
- ハッシュで指定するだけでOK
use Getopt::Long; my $opt_all = 0; my $opt_debug = 0; GetOptions('all' => \$opt_all, 'debug' => \$opt_debug); print "\$opt_all: $opt_all\n"; print "\$opt_debug: $opt_debug\n";