in reply to Example of complex constraint with HTML::FormValidator

In general, I'd try using something like:
constraints => { myfield => { constraint => sub { return (checkField() ? 1 : 0) }, params => [qw(myfield, otherparam1, otherparam2)], }, ... }
...where you can either use a subroutine checkField() or replace it with a short test right there in the anonymous subroutine.

There is an example in the documentation for the module, but it uses a built-in validation routine rather than an anonymous subroutine...

buckaduck