sub do_purity {
	local($score, @garb) = @_;
	$name = '';
	$score =~ /name=([^\&]+)\&/;
	$name = $1;
	$score =~ s/name=([^\&]+)\&//;

	@qs = split(/[\d\=\&]+/, $score);

	for(@qs){
		$pc++;
		$pscore++ if /no/;
		$pyscore++ if /yes/;
	}
	$ptot = $pscore+$pyscore;
	print("$pscore, $pyscore<p>\n");
	print("<h1>Your Purity Score is: $pscore out of ($ptot)</h1>\n");
	print("But you didn't answer all the questions, silly.\n") if $ptot != 100;
	print("You didn't give me your name!\n") if $name eq '';
	
	if($name && $ptot==100){
		open(PL, ">>/var/local/www/root/plist.html");
		print(PL "<li>$name:  $pscore\n");
		close(PL);
	}

}
1;
