#!/your/perl/here use strict; use warnings; use Getopt::Declare; unshift @ARGV, -one => 1, -two => 2 # <- defaults unless "@ARGV" =~ /(-help|-version)/; my $options = Getopt::Declare->new(<<'SPEC'); -one <one:i> first param: (default = 1) [repeatable] {$::one = $one; defer{ die "\t -one ($::one) > -two ($::two)\n" if $::one > $::two } } -two <two:i> second param: (default = 2) [repeatable] {$::two = $two} SPEC print "one = $options->{-one}\n"; print "two = $options->{-two}\n";
In reply to Re: Getopt::Declare parameter variables
by Anonymous Monk
in thread Getopt::Declare parameter variables
by QM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |