The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Sah::Simple - Simple interface to Data::Sah

VERSION

version 0.05

SYNOPSIS

 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

DESCRIPTION

This module provides more straightforward functional interface to Data::Sah. For full power and configurability you'll need to use Data::Sah compilers directly.

FUNCTIONS

None are exported, but they are exportable.

gen_validator($schema, \%opts) => CODE

Generate validator for $schema. %opts are passed to the Perl schema compiler.

SEE ALSO

Data::Sah

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

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.