Parse and validate simple name/value option pairs
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.
- Devel package for openSUSE:Factory
-
1
derived packages
- Links to openSUSE:Factory / perl-Data-OptList
- Download package
-
Checkout Package
osc -A https://api.opensuse.org checkout devel:languages:perl/perl-Data-OptList && cd $_
- Create Badge
Source Files
Filename | Size | Changed |
---|---|---|
Data-OptList-0.112.tar.gz | 0000019764 19.3 KB | |
_link | 0000000152 152 Bytes | |
cpanspec.yml | 0000000669 669 Bytes | |
perl-Data-OptList.changes | 0000002713 2.65 KB | |
perl-Data-OptList.spec | 0000002626 2.56 KB |
Revision 30 (latest revision is 34)
- updated to 0.112 see /usr/share/doc/packages/perl-Data-OptList/Changes 0.112 2021-06-26 11:01:31-04:00 America/New_York - no changes since last trial release (0.111) 0.111 2021-06-20 20:55:10-04:00 America/New_York (TRIAL RELEASE) - update author contact info - add perl version support to docs - replace a "goto" deep in the guts with a sub call, for speed (thanks, Olivier Mengué and Graham Knop)
Comments 0