Hallo!
Nur so gefragt, was gefällt die Data::FormValidator nicht?
Man kann dort alles von einfach bis hin zu komplexen validationsprofilen erstellen und prüfen. Außerdem gibt es eine Message-Methode, die die jeweiligen Fehlermeldungen benannter Constraints sammelz. Man kann sogar das hier:
QuoteIf the built-in message generation doesn't suit you, it is also possible to provide your own by specifying a code reference:
msgs => \&my_msgs_callback
This will be called as a Data::FormValidator::Results method. It may receive as arguments an additional hash reference of control parameters, corresponding to the key names in the usually used in the msgs area of the profile. You can ignore this information if you'd like.
If you have an alternative error message handler you'd like to share, stick in the Data::FormValidator::ErrMsgs name space and upload it to CPAN.
Es gibt auch die Möglichkeit, mehrere Constraints für 1 Feld zu definieren:
QuoteMultiple constraints can be applied to a single field by defining the value of the constraint to be an array reference. Each of the values in this array can be any of the constraint types defined above.