If you are wanting to password protect normal html pages look into .htaccess on unix servers. Not sure on NT. If you want to password protect a Perl script see my previous post on cookie password protection.

Read the win32::NetAdmin faq in the online activestate faq pages. They should be installed on you computer if you selected the option for them. It has a section for getting the user information and examples of how to them to get user information.