875c2ed049
A data domain is a description of a set of values, either scalar or structured (arrays or hashes). The description can include many constraints, like minimal or maximal values, regular expressions, required fields, forbidden fields, and also contextual dependencies. From that description, one can then invoke the domain's inspect method to check if a given value belongs to it or not. In case of mismatch, a structured set of error messages is returned. The motivation for writing this package was to be able to express in a compact way some possibly complex constraints about structured data. Typically the data is a Perl tree (nested hashrefs or arrayrefs) that may come from XML, JSON, from a database through DBIx::DataModel, or from postprocessing an HTML form through CGI::Expand. Data::Domain is a kind of tree parser on that structure, with some facilities for dealing with dependencies within the structure, and with several options to finely tune the error messages returned to the user. WWW: http://search.cpan.org/dist/Data-Domain/
16 lines
1 KiB
Text
16 lines
1 KiB
Text
A data domain is a description of a set of values, either scalar or structured
|
|
(arrays or hashes). The description can include many constraints, like minimal
|
|
or maximal values, regular expressions, required fields, forbidden fields, and
|
|
also contextual dependencies. From that description, one can then invoke the
|
|
domain's inspect method to check if a given value belongs to it or not. In case
|
|
of mismatch, a structured set of error messages is returned.
|
|
|
|
The motivation for writing this package was to be able to express in a compact
|
|
way some possibly complex constraints about structured data. Typically the data
|
|
is a Perl tree (nested hashrefs or arrayrefs) that may come from XML, JSON, from
|
|
a database through DBIx::DataModel, or from postprocessing an HTML form through
|
|
CGI::Expand. Data::Domain is a kind of tree parser on that structure, with some
|
|
facilities for dealing with dependencies within the structure, and with several
|
|
options to finely tune the error messages returned to the user.
|
|
|
|
WWW: http://search.cpan.org/dist/Data-Domain/
|