in reply to Perl and htaccess

You should take a look at mod_perl, a very powerful plugin for the Apache web server. The little popup dialog you get when accessing protected areas of a website is the default "Basic Authentication" handler. But with mod_perl you can write your own handler, and request that it be used for authentication of certain areas rather than the default.

Here are some links to get you started:

http://perl.apache.org/

http://www.modperl.com/

http://www.modperlbook.org/html/index.html