Dear list members

Maybe the perl-module-authors would be the more appropriate list for my 
question(s), but here are people confronted with the same tasks to solve when 
programming web applications, so...

Some of the tasks always to be solved in an interactive webapp:

a) validate/sanitize user input
b) differentiate between persistent parameter values and "volatile" ones (the
    latter meaning a value only used along one request/answer)

My idea is to have these points solved at one place in an (mod_perl) app, and 
then using something analogue to Apache::Request without the necessity of 
caring about a) and b) any more. 
   No parameter value should be accessible without being defined and 
validated.

===

Something like (some sort of pseudo code):

# central definition of parameters and their "attributes":
#
$definitions={ # hm, maybe better a class
 -dbh=>$dbh, # for Apache::Session
 -sessid_name=>'_sessid',
 # now validation specs:
 {-spec=>qr(^\w+$), # for params matching this; also name possible
  -callback=>$a_predefined_callback, # or sub {...}
  -trim_before_check=>1,
  -reset_on_absence=>0,
  -reset_on_false_value=>1,
  -persistency_mode=>'state', # or 'action', 'readonly', ...?
 }
 {...}
}

# usage in an app:
#
use Apache::Request::Validate; # example name space ;-)
my $vapreq=Apache::Request::Validate->instance($r, $definitions);
...
my @validated_values=$r->param('name1');

===

I must have overlooked online resources because I did not find something 
appropriate, although there are quite a lot modules that validate...

What do you use for these tasks?

Thanks a lot for any answers,  thoughts, comments, ...

joe,
after having posted two badly prepared answers to this great list, switching 
to a question :-)


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to