You might do better to look at the various "frameworks" that are available in Perl rather than "coding directly to CGI yourself." Many of these frameworks ... and some of them are very small and simple ... are already built to defend against the most common mistakes. And they're a lot faster to build with, too.
Comment on Re: is this script secured enough from internet attacks