in reply to Storing multiple arguments in a data structure that allows for future expansion
And to iterate the combinations of the arrays, see Math::Combinatorics.use Getopt::Std; my %opt; getopt('abc',\%opt); Multivalued(\%opt); #... sub Multivalued { # convert lists to array refs. my $href = shift; while( my ($k, $v ) = each %$href ) { my @anon = split /\,/, $v or next; $href -> { $k } = \@anon; } }
Update: and if you have to support protected commas in quotes, instead of just splitting, parse with something like Text::Csv::Simple
^M Free your mind!
|
|---|