I've seen this error message before. :-) It hits me when CGI is not configured properly, when there is an error in the script or when there is another configuration error (like in the .htaccess file). I suggest you try these things:
Check if your FormMail.pl file has execute permissions,
Check if the FormMail.pl script is without errors,
Check if you can run .pl files as GCI scripts. Sometimes they need to have the .cgi suffix.
Check if the FormMail.pl script runs with the perl interpreter on your server and if all required modules are installed.
So how you go about doing those things and how you fix them:
ad 1: Simply force the permissions on by issuing the command:
chmod +x /path/to/cgi-bin/FormMail.pl
If you use a GUI-based tool to manage your remote files, then you could do this via clicking but that depends highly on the tool you use.
ad 2: Try to run
perl -c /path/to/FormMail.pl
on the server or on your machine. If you do it on your machine and get the error that some modules could not be found, that's not a tragedy.
The gray code you posted here certainly doesn't look like a complete, yet alone functional perl script, so I hope the code goes on in your FormMail.pl file. Otherwise (or if you get syntax errors), you may need to look for another tool to do what you need or you can retry downloading that file.
ad 3: Try to run a minimalistic perl script as CGI. Do it this way:
Create a file named test.pl
Insert this text into it:
print "Content-type: text/plain\n\n";
print "CGI works.";
Upload this file into the cgi-bin folder and give it execute permissions
Point your browser to [url]http://your_site.com/cgi-bin/test.pl[/url] .
If that shows anything else than "CGI works", then your problem is in running cgi scripts. In such a case, try to rename the .pl files in the cgi-bin folder to .cgi and retry (with the filenames changed accordingly in the URL and in the form's action attribute). If you still get the same errors, you'll need to contact your admin to let you run CGI scripts.
ad 4: This might be the hardest thing to do if you only have FTP access. If you get to this point without finding the problem by the above methods, write again.
Hope this helps.