NAME

App::Manoc::Utils::Validate - Helpers for data validation.

VERSION

version 2.99.2

DESCRIPTION

These package contains helpers for data validation.

FUNCTIONS

validate($value, \%rule, %options)

Validate $value using %rule. Rule can have the following clauses:

type

On of scalar, array, hash.

arrayof

A rule to valudidate each element of an array value. No effects for other values of other types.

items

An hash reference to validate hash values, made of ('name_of_the_key', \%rule) pairs. See also required.

required

For rules used to validate hash values, set the element as required.

ignore_extra_items

When validating an hash values with items rules, do not return errors for unrecognized keys.

AUTHORS

  • Gabriele Mambrini <gmambro@cpan.org>

  • Enrico Liguori

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Gabriele Mambrini.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.