in reply to authenticate with perl
A js script executing in a browser can send a request to the server for a cgi script. The server will then execute the cgi script and send the results back to the browser. A cgi script can read or write non-public files and even store and retrieve information from a database.