BMaximus has asked for the wisdom of the Perl Monks concerning the following question:

Being a web programmer I am faced with the never ending task of verifying data thats coming in from forms on a web site. Its truly a repetitive (and rather boring) task. So I decided to write a rules based form verification script. I'm just wondering if there is some module out there that already does this so that I'm not reinventing the wheel. If it hasn't been made. What are your arguments for or against this type of module being made? And if its a good idea. Throw me some things you'd like to see on it.


What I mean by rules based:

the individual verifying the data creates a hash that has values describing the requirements of that particular input line.

i.e.

forms input line name is "bio" and its a text square.

%rule_hash = ( bio => { type => "text", no_html => 1, format => <hash_ref of options*>, no_null => 1, maxsize => 1000 } ) #* options based on Text::Format

Flames, constructive criticisms and likes are welcome
BMaximus

Replies are listed 'Best First'.
(dkubb) Re: (2) The repetitive task of form data verification
by dkubb (Deacon) on Mar 19, 2001 at 11:01 UTC

    A module I use and recommend very highly is HTML::FormValidator. It allows you to define a ruleset in a very similar fashion to yours. A bonus is that you can define rules for various "types" of data, then load these definition files at run-time. For example, this allows you to define an object (like a person) a single time, then re-use that definition in future projects.

      Thank you dkubb. I'll look in to it. I did search around CPAN for something like this. However it seems to have eluded me for some reason. I guess its all those late nights up till 4am.
      BMaximus