in reply to ldap authentication CGI
You probably want to look into Net::LDAP.
After you validate the user, you'll want to look into something like How can I maintain a session cookie?