#An example of the untainting code for a value not being deleted: if (param('house') =~ /^([\dA-Za-z '-]{1,20})$/ ) { $house = $1; } else { push @problem, "House name or number"; push @delete, "house"; } #And one that is: if (param('email1') =~ /^(([\w\.]{1,40})@([\w\.]{1,30}))$/ ) { $email = $1; } else { push @problem, "e-mail address"; push @delete, "email1"; } #I'm aware that this will disallow some valid e-mail addresses, but I'm not worrying about that for the moment #And the code that should delete all the invalid input: my $i; foreach $i (@delete) { $query->delete($i); }