Firstly, regarding PHP scripts, they actually need to go into the HTML folder to work correctly.
As for the perl stuff, my guesses are as follows:
1 - permissions. You may need to check that the scripts have the executable permissions set. (eg. When you do an 'ls -la' in the folder, it shows something like rwxr-xr-x).
2 - buffers. Apache (along with most other wbe servers) are pretty picky about how long it takes for CGI stuff to return something. I'd suggest using the CGI module that comes standard with most Perl installations. You can find out more about this beast either by running 'Perldoc -U CGI' on the server or visiting sites such as perlmonks.org.
In either case, a look at the apache error logs is probably the best place to start.
You can access the logs from the admin web pages (only in SME v5+) or from the command line as follows:
tail /var/httpd/logs/error_log
Regards,
Luke