in reply to Perl/CGI Security Question

I'd suggest you the documentation of user_manage, a script by Lincoln Stein.
There you can find a lot of answers and ideas (...and at the end you''ll probably use the script itself or something very similar :) ).
Hope this helps
ciao, Roberto