So to clarify, when you say "file is promted to download in webrowser", you are referring to the simple perl file I pasted in to my previous reply? i.e. you get a prompt to download the actual perl file?
What URL are you typing in exactly? Is it http://localhost/cgi-bin/yourPerlFile.pl ? (The cgi-bin part is important).
If you have modified /etc/httpd/httpd.conf recently, did you remember to stop and restart apache via your System Preferences/Sharing/Personal Web Sharing? If not, your changes weren't updated despite what it may appear. Stop and restart to be sure.
We're narrowing it down. Don't give up!