I just tested this on my linux box here and it worked just fine. Run the script from the web browser and then check your error log. This should give an indication of the problem. Two possible problems:
The script's permissions are not set where apache can execute it.
The directory you are trying to run the script from doesn't have permission to exec cgi scripts