in reply to generic getopt to hash
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: generic getopt to hash
by bv (Friar) on Oct 01, 2009 at 18:30 UTC | |
by jakobi (Pilgrim) on Oct 01, 2009 at 18:58 UTC |