Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to get all options from Getopt Long without specifc knowledge of the params?
- use Getopt::Long qw(GetOptionsFromArray);
- my %options;
- my @opt_spec = qw(a:s b:s c:s d:s e:s f:s g:s h:s i:s j:s k:s l:s m:s n:s o:s p:s r:s q:s r:s s:s t:s u:s v:s w:s x:s y:s z:s);
- Getopt::Long::GetOptions(%options, @opt_spec);
- -a=-b -c -d -e -f g --h -- -i -j
- my %options = (
- 'a' => '-b',
- 'c' => '',
- 'd' => '',
- 'e' => '',
- 'f' => 'g'
- 'h' => '',
- );
- @ARGV = (
- '-i',
- '-j',
- );
- my %options = (
- 'a' => '-b',
- 'c' => '-d',
- 'e' => '-f',
- 'h' => '--',
- 'i' => '-j'
- );
- @ARGV = (
- 'g',
- );
- my @opt_spec = map "$_:s", 'a'..'z';
Add Comment
Please, Sign In to add comment