CGI Paramater Validation CPAN Modules 15 of 32 : [PREV] [NEXT]

Data::FormValidator

This a simple profile, but it does cover the general idea.

my $profile = {
       optional => [qw( company
                        fax
                        country )],

       required => [qw( fullname
                        phone
                        email
                        address )],

       dependancies => {
           company => [ fax ] },

       defaults => {
           country => 'UK' },

       constraints => {
           email => 'email' }
};

In addition there are other profile entries that can perform tasks such as trim filters, but as a general rule the entries only validate on whether a is found or not. Something the other two can do. However using the arrays of invalids, missing and unknowns we can get back some useful information for error handling.


© 2003 Barbie barbie@missbarbell.co.uk Home http://birmingham.pm.org/