in reply to Dynamic option
I was surprised a feature was recently added to Getopt::Long (2.35, to be specific) to addresses this very need!
$ perl -MData::Dumper -MGetopt::Long -e' my %options = ( input => [] ); GetOptions(\%options, "input=s{0,}", "des=s", "r=i") or die; print(Dumper(\%options)); ' -- -input data modem apps -des "finding files" -r 1000 $VAR1 = { 'r' => 1000, 'input' => [ 'data', 'modem', 'apps' ], 'des' => 'finding files' };
It's marked as experimental.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Dynamic option
by Anonymous Monk on Mar 16, 2011 at 03:57 UTC | |
by ikegami (Patriarch) on Mar 16, 2011 at 06:15 UTC | |
by Anonymous Monk on Mar 16, 2011 at 05:31 UTC | |
by ikegami (Patriarch) on Mar 16, 2011 at 06:19 UTC | |
by Anonymous Monk on Mar 16, 2011 at 12:14 UTC | |
by Anonymous Monk on Mar 16, 2011 at 06:25 UTC | |
by ikegami (Patriarch) on Mar 16, 2011 at 06:28 UTC |
In Section
Seekers of Perl Wisdom