Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
package TEST::Validator::Test; use Data::FormValidator; use strict; @TEST::Validator::Test::ISA= qw( Data::FormValidator ); use constant LOGIN => 'login'; my $form_validations = { LOGIN() => { required => [ qw( ipf_org_username ipf_username ) ], optional => [ qw( ipf_password ipf_confirm_password ) ], constraints => { ipf_passowrd => { constraint => "check_password +", params => [ qw( ipf_passw +ord ipf_confirm_password ) ], }, } }, }; sub get_validator { my $self = shift; my %args = @_; my $validator = new $self( $form_validations ); return($validator); } sub check_password { my ( $password, $confirm_password ) = shift; return ( $password eq $confirm_password ); } sub valid_check_password { my ( $password, $confirm_password ) = shift; return ( $password eq $confirm_password ); } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Data::FormValidator constraints against local sub routine
by cees (Curate) on Dec 08, 2003 at 20:55 UTC | |
|
Re: Data::FormValidator constraints against local sub routine
by jdtoronto (Prior) on Dec 08, 2003 at 20:45 UTC | |
|
Re: Data::FormValidator constraints against local sub routine
by Anonymous Monk on Dec 08, 2003 at 21:06 UTC |