http://qs321.pair.com?node_id=893535


in reply to Re^4: Dynamic option
in thread Dynamic option

As the author of Getopt::Long always says, options are optional, or they wouldn't be options. So the "they may or may not be present" isn't anything special. In fact, it's the bread and butter of Getopt::Long - it only deals with things that may or may not be present.

If you make the call syntax like:

findfiles --input data modem apps --nd --na --nc --des "..." -r 1000
Something like:
GetOptions 'input=s{0,}' => \my @input, 'na' => \my $na, 'nd' => \my $nd, 'nc' => \my $nc, 'des=s' => \my $des, 'r=i' => \my $r;
Should do the trick.