The way the HTML code recognizes what kind of file your trying to run is in the extension of the file. If your HTML link is

Code:
<a href="cgi-bin/hello.pl">
The extension of the file is pl, which is an extension for perl files.

And your concernments about setting up a web server..if your only going to have HTML files, you don't even need to worry about a /cgi-bin.

Hope I helped you out.