use CGI; my $cgi = new CGI; my $user = $cgi->param("username"); my $pass = $cgi->param("password"); my $valid = 0; # Assuming usernames/passwords in a delimited text file open(IN, "passwordFile") or die(...); while() { if( /^$user\:$pass$/ ) { $valid = 1; last; } } close(IN) if(!$valid) { print "Sorry, you may not access this page."; exit; } #set authentication #set a cookie here using javascript or #add hidden fields with login info print ""; print ""; Store usernames/passwords in a file as follows: johndoe:myPassw0rd user2:pass2 user3:pass3 etc