The Data::FormValidator docs say:
====
A hash ref with field names as keys. Values are array references of built-in filters to apply (trim,digit,etc) or an anonymous subroutine which should take one parameter, the field value and return the (possibly) modified value.field_filters field_filters => { cc_no => ['digit'], },
=====
OK so far, I want to use the mentioned anonymous sub. I'm not sure on the syntax. (How do I specify the input to pass in?) I set up a working sub MyFilter that takes one param. I tried:
That doesn't work, which doesn't surprize me as I don't see how MyFilter is getting its input.field_filters => { name_field => [ \MyFilter() ], },
Your comments and a working example would be much appreciated.
UPDATE: minor edit for a more illustrative field name
UPDATE 2: Working example from [monk://Tanktalus] :
field_filters => { name_field => [ \&MyFilter ], },
Cheers
--Fred
-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday
In reply to Data::FormValidator question by freddo411
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |