Data::Schema::Plugin::LoadSchema::YAMLFile - Plugin to load schemas from YAML files
version 0.136
# in schemadir/even_int.yaml - int - divisible_by: 2 # in your code use Data::Schema; my $ds = Data::Schema->new; $ds->register_plugin('Data::Schema::Plugin::LoadSchema::YAMLFile'); $ds->config->schema_search_path(["schemadir"]); my $res; $res = $ds->validate(2, 'even_int'); # success $res = $ds->validate(3, 'even_int'); # fails
Return schema loaded from YAML file, or undef if not found. List of directories to search for is specified in validator's schema_search_path config variable. "$name", "$name.{yaml,yml}" files will be searched for.
undef
schema_search_path
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.