And in general I believe the scripts do not get server directly from that file path public_html/cgi-bin/ (the files should be placed there but they get server from another path).
I see the permissions are incorrect for a suPHP system. Checking if that is the issue.
It works when running it via perl on the server:
root@prime [/home/coolscri/public_html/cgi-bin]# perl /home/coolscri/public_html/cgi-bin/test.pl
How are you trying to run it? As a browser will not run it directly
As far as running perl it would be done with the script itself and it does work in that location. To run any test that would need to server it up in some other page that then calls that script from that location if that makes sense.
But you will get a 404 errors doing this - http://domain.com/cgi-bin/test.pl
As a browser can not serve it from that location