#!/usr/bin/perl use strict; use warnings; use Data::FormValidator::Constraints qw(:closures); use Data::FormValidator; my %input = ( input1 => 'eins', input2 => 'zwei', input3 => 'drei', input4 => 'vier'); my $results = validate_input(\%input); print "result=$results\n"; sub validate_input{ my $input_hash_ref = shift; my $big_test = { filters => 'trim', required => [qw( input1 input2 input3 input4 )], constraint_methods => { test1 => validate_test1( 'exists', {fields => [qw( input1 ) ]} ), test2 => validate_test2( 'exists', {fields => [qw( input2 ) ]} ), test3 => validate_test3( 'exists', {fields => [qw( input3 ) ]} ), test4 => validate_test4( 'exists', {fields => [qw( input4 ) ]} ), } }; my $results = Data::FormValidator->check($input_hash_ref, $big_test); return($results); } sub validate_test1{ return; } sub validate_test2{ return; } sub validate_test3{ return; } sub validate_test4{ return; }