Parse and validate simple name/value option pairs
http://search.cpan.org/dist/Data-OptListHashes 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.
- Devel package for openSUSE:Factory
-
2
derived packages
- Links to openSUSE:Factory / perl-Data-OptList
- Download package
Source Files (show merged sources derived from linked package)
Filename | Size | Changed |
---|---|---|
Data-OptList-0.110.tar.gz | 0000018846 18.4 KB | almost 5 years |
_link | 0000000152 152 Bytes | almost 5 years |
cpanspec.yml | 0000000669 669 Bytes | almost 5 years |
perl-Data-OptList.changes | 0000002103 2.05 KB | almost 5 years |
perl-Data-OptList.spec | 0000002724 2.66 KB | almost 5 years |
Comments for perl-Data-OptList 0