Data::Schema::Type::TypeName - Type handler for DS type 'typename'
version 0.136
use Data::Schema;
This is type handler for 'typename'. It is just like string, except it only accepts valid type names (/^[a-z][a-z0-9_]$/).
This is used for validating DS schemas and does not have much use elsewhere.
Example:
ds_validate("int", "typename"); # valid ds_validate("integer number", "typename"); # invalid, contains whitespace
Aside from attributes from string, here are other recognized attributes:
If true, require that type name is known at that point of the validation.
ds_validate("foo", [typename=>{known=>1}); # invalid, foo is not a known type ds_validate("foo", {def => {foo=>"str"}, attr_hashes => [{known=>1}], type => "typename"}); # valid, foo is known here
If true, require that type name is a schema type.
ds_validate("int", [typename=>{isa_schema=>1}]); # invalid, int is not a schema type ds_validate("foo", [typename=>{isa_schema=>1}]); # valid if foo is a schema type
Data::Schema::Type::Str
Data::Schema::Schema::Schema
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2009 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Schema, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Schema
CPAN shell
perl -MCPAN -e shell install Data::Schema
For more information on module installation, please visit the detailed CPAN module installation guide.