I believe that you may also use CGI.pm
to do handle basic authentication, but I've moved completely away from basic authentication (and the annoying popup windows) to creating HTML forms for login.
The amount of complication really depends on your web server and how you want to use basic authentication. With Apache you can use an .htaccess file to require users to login with a username and password. I've rarely used that method because I was not able to find a way to log users out or to change identities--I wanted more control. If you are looking for the least complex method of authentication, I recommend that you check your web server's documentation.