#don't name it $password in real life! my $crypted = $crypt($password, $key); open (PASSWORD, ".somefile") or die "login failed"; if ($crypted eq ) { let them in } else { don't let them in }