Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Input Filtering Requirementsby Anonymous Monk |
on Aug 10, 2003 at 09:35 UTC ( [id://282589]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: Hi, I'm setting up a few scripts to grab user input and store it in CSV files. The user input will consist of personal information such as name and email address and other information from survey forms consisting mostly of radio buttons and checkboxes. What I'm trying to ensure is that all incoming data is filtered properly. Since I'm just storing the data, my primary concern is the length of the data. How is the best way to filter this? Just use Perl's length function as in if (length($blah) > $max_length) { error(); }? I'm also validating some data using Email::Valid and it's nice little regex. Is there any other validation/checking I should be doing? I'm so used to filtering out questionable characters, but is there any point if I just storing this in a file? I'm not doing anything silly like using the input to name the file, so filtering combinations such as "../" doesn't appear necessary. Thank you in advance for your advice.
Back to
Seekers of Perl Wisdom
|
|