I've never seen a program that expects arguments like --list a b c. Normally, it's --list a --list b --list c.
Anyway, how can you tell the difference between the following without configuration:
--list a b c ⇒ $opts{list} = [qw( a b c )]; @ARGV = qw( );
--name a b c ⇒ $opts{name} = 'a'; @ARGV = qw( b c );
--flag a b c ⇒ $opts{flag} = 1; @ARGV = qw( a b c );
You'll need to add restrictions.
Updated format
In reply to Re: generic getopt to hash
by ikegami
in thread generic getopt to hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |