In order to run scripts through the server, you also have to configure your server. You need to enable scripting at all, plus you need to enable the directory you are running scripts in to be executable. It is well documented in the httpd.conf how to do this.
The section you are looking for looks something like this:
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Then later on:
# AddHandler allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
#
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
AddHandler cgi-script .cgi
And further down:
# If the perl module is installed, this will allow execution of mod_perl
# to compile your scripts to subroutines which it will execute directly,
# avoiding the costly compile process for most requests.
#
## UNCOMMENTING FOR SCRIPTS
<IfModule mod_perl.c>
Alias /perl /var/www/perl
<Directory /var/www/perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Directory>
</IfModule>
##############################################
## ADDING DIRECTORIES FOR EXEC PRIVS (example by bubba)
##############################################
<Directory /home/username/public_html/cgi-bin>
Options +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>