First off, use the wonderful CGI module that comes with perl.
Then read up on your webserver documentation so you can keep people from reading files inside the /cgi-bin/ directory. I believe Apache comes pre-configured to not let files be read from the cgi-bin directory..
Comment on Re: How to prevent database from listing/viewing?