Data::Schema::Type::Str - Type handler for string ('str')
version 0.136
use Data::Schema;
This is type handler for 'str'.
Strings are Comparable, Sortable, and HasElement, so you might want to consult the docs of those roles to see what type attributes are available.
In addition to these, string has some additional attributes:
Aliases: matches
Require that the string match a regular expression.
Aliases: not_matches
The opposite of match, require that the string not match a regular expression.
If value is true, require that the string be a valid regular expression string. If value is false, require that the string not be a valid regular expression string.
Example:
ds_validate("(foo|bar)" => [str => {set=>1, isa_regex=>1}); # valid ds_validate("(foo|bar" => [str => {set=>1, isa_regex=>1}); # invalid, unmatched "(" in regex ds_validate("(foo|bar" => [str => {set=>1, isa_regex=>0}); # valid
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.