NAME
Data::Type - robust and extensible data- and valuetype system
VERSION
0.02.01 (Thu Dec 31 13:59:04 2009)
DESCRIPTION
This module delivers an easy, generic and unified interface to type related CPAN modules. They all have one common purpose: reporting if data has some "characteristics". And this module wraps that with a clean api.
SYNOPSIS
use Data::Type qw(:is +ALL);
is STD::EMAIL or warn;
warn if isnt STD::CREDITCARD( 'MASTERCARD', 'VISA' );
try
{
valid( '9999-12-31 23:59:59', DB::DATETIME );
}
catch Data::Type::Exception with
{
print $e->to_string foreach @_;
};
EXAMPLES
Visit the Data::Type::Docs::Howto to explore how to use this module for DBI, CGI, Getopt and more scenarios.
INSTALLATION
I highly recommend to use CPAN for one-stop-shop installation:
perl -MCPAN -e "install Data::Type"
SUPPORTED TYPES
All types are grouped and though belong to a collection. The collection is identified by a short id. All members are living in a namespace that is prefixed with it (uppercased).
- Standard Collection ('STD')
-
This is a heterogenous collection of datatypes which is loaded by default. It contains various issues from CPAN modules (i.e. business, creditcard, email, markup, regexps and etc.) and some everyday things. See Data::Type::Collection::Std.
- W3C/XML-Schema Collection ('W3C')
-
A nearly 1-to-1 use of XML::Schema datatypes. It is nearly complete and works off the shelf. Please visit the XMLSchema http://www.w3.org/TR/xmlschema-2/ homepage for sophisticated documentation. See Data::Type::Collection::W3C.
- Database Collection ('DB')
-
Common database table types (VARCHAR, TINYTEXT, TIMESTAMP, etc.). See Data::Type::Collection::DB.
- Biological Collection ('BIO')
-
Everything that is related to biological matters (DNA, RNA, etc.). See Data::Type::Collection::Bio.
- Chemistry Collection ('CHEM')
-
Everything that is related to chemical matters (Atoms, etc.). See Data::Type::Collection::Chem.
- Perl5 Collection ('PERL')
-
Reserved and undecided. See Data::Type::Collection::Perl.
- Perl6 Apocalypse Collection ('PERL6')
-
Placeholder for the Apocalypse and Synopsis 6 suggested datatypes for perl6. See Data::Type::Collection::Perl6.
[Note] ALL
is a an alias for all available collections at once.
PREREQUISITES
Following modules get automatically installed via the CPAN module. See INSTALLATION above. Data::Type has a mechanism for delayed loading of modules. This means modules are loaded only when the used types require them, not all at once.
READON
Visit the Data::Type main documentation or advance directly to the Data::Type::Docs manpage.
COPYRIGHT/LICENSE
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 53:
alternative text 'W3C/XML-Schema Collection ('W3C')' contains non-escaped | or /