O’reilly has a nice page about securely programming CGI with Perl that is a sample chapter from <a href="http://www.oreilly.com/catalog/cgi2/chapter/ch08.html" title="CGI Programming with Perl, 2nd Edition: Chapter 8: Security">CGI Programming with Perl, 2nd Edition</a>. It includes a nice discussion about tainted data, why it is a good thing, and how to remove the taint from it.