Parse and validate simple name/value option pairs

Edit Package perl-Data-OptList
http://search.cpan.org/dist/Data-OptList

Hashes are great for storing named data, but if you want more than one
entry for a name, you have to use a list of pairs. Even then, this is
really boring to write:

$values = [
foo => undef,
bar => undef,
baz => undef,
xyz => { ... },
];

Just look at all those undefs! Don't worry, we can get rid of those:

$values = [
map { $_ => undef } qw(foo bar baz),
xyz => { ... },
];

Aaaauuugh! We've saved a little typing, but now it requires thought to
read, and thinking is even worse than typing.

With Data::OptList, you can do this instead:

$values = Data::OptList::mkopt([
qw(foo bar baz),
xyz => { ... },
]);

This works by assuming that any defined scalar is a name and any
reference following a name is its value.

Refresh
Refresh
Source Files
Filename Size Changed
Data-OptList-0.107.tar.gz 0000013735 13.4 KB
old_test_more.patch 0000000566 566 Bytes
perl-Data-OptList.changes 0000001457 1.42 KB
perl-Data-OptList.spec 0000003089 3.02 KB
Revision 21 (latest revision is 34)
Lars Vogdt's avatar Lars Vogdt (lrupp) committed (revision 21)
- remove old_test_more.patch and use sed statement
  instead (less likely to break with every package update)
Comments 0
openSUSE Build Service is sponsored by