Params::Validate::Dependencies is a Perl module that extends Params::Validate to make it easy to validate that you have been passed the correct combinations of parameters.
SYNOPSIS
This example validates that sub 'foo's arguments are of the right types, and that either we have at least one of alpha, beta and gamma, or we have both of bar amd baz:
use Params::Validate::Dependencies qw(:all);
sub foo {
validate(@_,
{
alpha => { type => ARRAYREF, optional => 1 },
beta => { type => ARRAYREF, optional => 1 },
gamma => { type => ARRAYREF, optional => 1 },
bar => { type => SCALAR, optional => 1 },
baz => { type => SCALAR, optional => 1 },
},
any_of(
qw(alpha beta gamma),
all_of(qw(bar baz)),
)
);
}
Product's homepage
Requirements:
· Perl