Why not have a read at Ovid's Web Programming Using Perl tutorial. lesson 3 (though you should invest time reading the previous two lessons also) is titled Basic CGI Security which covers many things including user input. CGI security is a topic that is covered quite frequently, Super Search should return more helpful information.