in reply to Apache Problems

You are correct, the CGI will not see the Basic authentication header. Chapter 6 of Writing Apache Modules with Perl and C covers authentication.