if (crypt($password, $hash) ne $hash) { die "Sorry...\n"; } else { print "ok\n"; }