Data::Sah::Simple - Simple interface to Data::Sah
version 0.05
use Data::Sah::Simple qw( gen_validator ); my $s = ['int*', min=>1, max=>10]; # generate validator my $vdr = gen_validator($s, \%opts); # validate your data using the generated validator $res = $vdr->(5); # valid $res = $vdr->(11); # invalid $res = $vdr->(undef); # invalid $res = $vdr->("x"); # invalid
This module provides more straightforward functional interface to Data::Sah. For full power and configurability you'll need to use Data::Sah compilers directly.
None are exported, but they are exportable.
Generate validator for $schema. %opts are passed to the Perl schema compiler.
$schema
%opts
Data::Sah
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2012 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::Sah, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Sah
CPAN shell
perl -MCPAN -e shell install Data::Sah
For more information on module installation, please visit the detailed CPAN module installation guide.