If your web server does not allow you to run CGI scripts outside of the 'cgi-bin' directory, you can enable CGI.
You will want to create an .htaccess file in the directory that you want to allow the CGI scripts to run. In the .htaccess file you want to add the following information:
AddHandler cgi-script .pl
This will allow cgi scripts ending with .pl and .cgi to be run. You will need to make sure that your scripts have execute permissions as well.