A couple of options come to mind right away.
First, in your httpd.conf, create a <Directory ...></Directory> block. Within that you can use "allow none" and "allow from ..." to control access to the directory.
allow from domain.com
That might work
. MIGHT. Not sure, haven't tried that out.
Another option is to use a .htaccess file to control visitors access to the scripts. Do some hunting on the web for how they work. They're pretty easy to use.
My last suggestion, and most complicated, is to build a login page in Perl and use a MySQL database backend to store the valid users and passwords. I have several things I've written that use this approach, but I used PHP.