Declare::Constraints::Simple 0.03 review
DownloadDeclare::Constraints::Simple is a Perl module for Declarative Validation of Data Structures. SYNOPSIS use Declare::Constraint
|
|
Declare::Constraints::Simple is a Perl module for Declarative Validation of Data Structures.
SYNOPSIS
use Declare::Constraints::Simple-All;
my $profile = IsHashRef(
-keys => HasLength,
-values => IsArrayRef( IsObject ));
my $result1 = $profile->(undef);
print $result1->message, "n"; # 'Not a HashRef'
my $result2 = $profile->({foo => [23]});
print $result2->message, "n"; # 'Not an Object'
print $result2->path, "n";
# 'IsHashRef[val foo].IsArrayRef[0].IsObject'
The main purpose of this module is to provide an easy way to build a profile to validate a data structure. It does this by giving you a set of declarative keywords in the importing namespace.
Requirements:
Perl
Declare::Constraints::Simple 0.03 keywords