CGI is the way to go. It's the only way to go. There are some smaller versions that do much of what CGI.pm does, but CGI is just fine in it's full form.
There's a lot to the discussion, but in a nutshell tainting is not really necessary if you are just collecting input and writing it to a database. One assumes that your normal validation of the input, e.g., did they enter a number when they should have entered letter, will protect what goes into the database. In fact, setting the -T switch will have no effect on this kind of input that stays 'inside the system.'
However, it's a must if you are using it to do something that involves file or directory manipulation, shells and the like. That is the only time I have found that the -T switch will scream if you neglect to untaint. Here's a sample untaint:
my $url=~ /(http://www.[\w-.]+)/; my $untainted_url = $1;
Make sure that you really do test the value for what it should be and don't cheat with something ineffectual like:
my $url=~ /([\w-.]+)/; my $untainted_url = $1;
Update: Forgot about Ovid's great little node "Use CGI or die;" comparing CGI to other methods.
In reply to Re: Form, Input, Taint related
by bradcathey
in thread Form, Input, Taint related
by Ny_Worker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |