in reply to Dates and formvalidation

Thanks Larsen, I did try to write my own constraint and though it does not give me any error, it does not perform the validation. Here is my code-
my $profile = { required => ['holidayfrom','holidayto'], optional => ['usercomments'], filters => ['trim'], constraints => { hoidayto => { params => [ 'holidayfrom', 'holidayto' ], constraint => sub { my $from = shift; my $to = shift; my ($d1,$m1,$y1) = split("/",$from); my ($d2,$m2,$y2) = split("/",$to); my $Dd = Delta_Days( $y1, $m1, $d1, $y2, $m2, $d2 ); if($Dd < 0){return 1;} return 0; } } }, msgs=>{ any_errors => 'err__', prefix=>'err_', }, };

I am sure I am making some basic mistake. I am fairly new to Perl.