in reply to how to compile it

A module is normally called from other perl programs, it is like a library file (dll file if you live in the windows world). So executing it is somewhat the wrong idea.

Webservers will usually only recognize files with extension .pl as executables in their config, or a special directory for executable files (often called .../cgi_bin), or require you to add a .htaccess file (see documentation of the webserver for the details) to directories you want to make executable

++ to the Anonymous Monk who mentioned the cgi help guide, a nice summary of cgi problems