X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FParams%2FValidate.pm;h=6997aca1bfe7d35f7cc841ff2146940b0dc2f016;hb=0a0bf9c2d3a08e5798015de93643dd9fd47f35d1;hp=e05c0b7c0e3b239a3301bc9c29a37dd7712f7cde;hpb=ddc128beb3cc265ce4be4854b4431e2246f788ee;p=gitmo%2FMooseX-Params-Validate.git diff --git a/lib/MooseX/Params/Validate.pm b/lib/MooseX/Params/Validate.pm index e05c0b7..6997aca 100644 --- a/lib/MooseX/Params/Validate.pm +++ b/lib/MooseX/Params/Validate.pm @@ -7,8 +7,10 @@ use Carp 'confess'; use Devel::Caller 'caller_cv'; use Scalar::Util 'blessed', 'refaddr', 'reftype'; -use Moose::Util::TypeConstraints qw( find_type_constraint class_type role_type ); -use Params::Validate (); +use Moose 0.58 (); +use Moose::Util::TypeConstraints + qw( find_type_constraint class_type role_type ); +use Params::Validate 0.88 (); use Sub::Exporter -setup => { exports => [ qw( validated_hash validated_list pos_validated_list validate validatep ) @@ -48,7 +50,7 @@ sub validated_hash { my $instance; $instance = shift @$args if blessed $args->[0]; - my %args + my %args = @$args == 1 && ref $args->[0] && reftype( $args->[0] ) eq 'HASH' ? %{ $args->[0] } : @$args; @@ -101,7 +103,7 @@ sub validated_list { my $instance; $instance = shift @$args if blessed $args->[0]; - my %args + my %args = @$args == 1 && ref $args->[0] && reftype( $args->[0] ) eq 'HASH' ? %{ $args->[0] } : @$args; @@ -412,9 +414,9 @@ below, simply pass them after the list of parameter validation specs: =head1 ALLOWING EXTRA PARAMETERS By default, any parameters not mentioned in the parameter spec cause this -module to throw an error. However, you can have have this module simply ignore -them by setting C to a true value when calling -a validation subroutine. +module to throw an error. However, you can have this module simply ignore them +by setting C to a true value when calling a +validation subroutine. When calling C or C the extra parameters are simply returned in the hash or list as appropriate. However, when you call