#!/usr/bin/perl # $Header: /cys/people/brenner/http/docs/web/RCS/combined-form.cgi,v 1.4 1996/03/29 22:59:29 brenner Exp $ # Copyright (C) 1994 Steven E. Brenner # This is a small demonstration script to demonstrate the use of # the cgi-lib.pl library, where the script both creates the form and # processes its input require "cgi-lib.pl"; MAIN: { # Read in all the variables set by the form if (&ReadParse(*input)) { &ProcessForm; } else { &PrintForm; } } sub ProcessForm { # Print the header print &PrintHeader; # Do some processing, and print some output ($text = $input{'text'}) =~ s/\n/\n
/g; # add
's after carriage returns # to multline input, since HTML does not # preserve line breaks ($total=$input{'L01'}+$input{'L02'}+$input{'L03'}+$input{'L04'}+ $input{'L05'}+$input{'L06'}+$input{'L07'}+$input{'L08'}+ $input{'L09'}+$input{'L10'}+$input{'L11'}+$input{'L12'}+ $input{'L13'}+$input{'L14'}+$input{'L15'}+$input{'L16'}+ $input{'L17'}+$input{'L18'}+$input{'L19'}+$input{'L20'}+ $input{'L21'}+$input{'L22'}+$input{'L23'}+$input{'L24'}+ $input{'L25'}+$input{'L26'}+$input{'L27'}+$input{'L28'}+ $input{'L29'}+$input{'L30'}+$input{'L31'}+$input{'L32'}+ $input{'L33'}+$input{'L34'}+$input{'L35'}+$input{'L36'}+ $input{'L37'}+$input{'L38'}+$input{'L39'}+$input{'L40'}+ $input{'L41'}+$input{'L42'}+$input{'L43'}+$input{'L44'}+ $input{'L45'}+$input{'L46'}+$input{'L47'}+$input{'L48'}+ $input{'L49'}+$input{'L50'}+$input{'L51'}+$input{'L52'}+ $input{'L53'}+$input{'L54'}+$input{'L55'}+$input{'L56'}+ $input{'L57'}+$input{'L58'}+$input{'L59'}+$input{'L60'}+ $input{'L61'}+$input{'L62'}+$input{'L63'}+$input{'L64'}); open (COMMENTSFILE,">>total"); print COMMENTSFILE "$total\n"; close COMMENTSFILE; if (length($input{'L01'})<1) {($input{'L01'}="B");} if (length($input{'L02'})<1) {($input{'L02'}="B");} if (length($input{'L03'})<1) {($input{'L03'}="B");} if (length($input{'L04'})<1) {($input{'L04'}="B");} if (length($input{'L05'})<1) {($input{'L05'}="B");} if (length($input{'L06'})<1) {($input{'L06'}="B");} if (length($input{'L07'})<1) {($input{'L07'}="B");} if (length($input{'L08'})<1) {($input{'L08'}="B");} if (length($input{'L09'})<1) {($input{'L09'}="B");} if (length($input{'L10'})<1) {($input{'L10'}="B");} if (length($input{'L11'})<1) {($input{'L11'}="B");} if (length($input{'L12'})<1) {($input{'L12'}="B");} if (length($input{'L13'})<1) {($input{'L13'}="B");} if (length($input{'L14'})<1) {($input{'L14'}="B");} if (length($input{'L15'})<1) {($input{'L15'}="B");} if (length($input{'L16'})<1) {($input{'L16'}="B");} if (length($input{'L17'})<1) {($input{'L17'}="B");} if (length($input{'L18'})<1) {($input{'L18'}="B");} if (length($input{'L19'})<1) {($input{'L19'}="B");} if (length($input{'L20'})<1) {($input{'L20'}="B");} if (length($input{'L21'})<1) {($input{'L21'}="B");} if (length($input{'L22'})<1) {($input{'L22'}="B");} if (length($input{'L23'})<1) {($input{'L23'}="B");} if (length($input{'L24'})<1) {($input{'L24'}="B");} if (length($input{'L25'})<1) {($input{'L25'}="B");} if (length($input{'L26'})<1) {($input{'L26'}="B");} if (length($input{'L27'})<1) {($input{'L27'}="B");} if (length($input{'L28'})<1) {($input{'L28'}="B");} if (length($input{'L29'})<1) {($input{'L29'}="B");} if (length($input{'L30'})<1) {($input{'L30'}="B");} if (length($input{'L31'})<1) {($input{'L31'}="B");} if (length($input{'L32'})<1) {($input{'L32'}="B");} if (length($input{'L33'})<1) {($input{'L33'}="B");} if (length($input{'L34'})<1) {($input{'L34'}="B");} if (length($input{'L35'})<1) {($input{'L35'}="B");} if (length($input{'L36'})<1) {($input{'L36'}="B");} if (length($input{'L37'})<1) {($input{'L37'}="B");} if (length($input{'L38'})<1) {($input{'L38'}="B");} if (length($input{'L39'})<1) {($input{'L39'}="B");} if (length($input{'L40'})<1) {($input{'L40'}="B");} if (length($input{'L41'})<1) {($input{'L41'}="B");} if (length($input{'L42'})<1) {($input{'L42'}="B");} if (length($input{'L43'})<1) {($input{'L43'}="B");} if (length($input{'L44'})<1) {($input{'L44'}="B");} if (length($input{'L45'})<1) {($input{'L45'}="B");} if (length($input{'L46'})<1) {($input{'L46'}="B");} if (length($input{'L47'})<1) {($input{'L47'}="B");} if (length($input{'L48'})<1) {($input{'L48'}="B");} if (length($input{'L49'})<1) {($input{'L49'}="B");} if (length($input{'L50'})<1) {($input{'L50'}="B");} if (length($input{'L51'})<1) {($input{'L51'}="B");} if (length($input{'L52'})<1) {($input{'L52'}="B");} if (length($input{'L53'})<1) {($input{'L53'}="B");} if (length($input{'L54'})<1) {($input{'L54'}="B");} if (length($input{'L55'})<1) {($input{'L55'}="B");} if (length($input{'L56'})<1) {($input{'L56'}="B");} if (length($input{'L57'})<1) {($input{'L57'}="B");} if (length($input{'L58'})<1) {($input{'L58'}="B");} if (length($input{'L59'})<1) {($input{'L59'}="B");} if (length($input{'L60'})<1) {($input{'L60'}="B");} if (length($input{'L61'})<1) {($input{'L61'}="B");} if (length($input{'L62'})<1) {($input{'L62'}="B");} if (length($input{'L63'})<1) {($input{'L63'}="B");} if (length($input{'L64'})<1) {($input{'L64'}="B");} open (COMMENTSFILE,">>results"); print COMMENTSFILE "$input{'L01'}"; print COMMENTSFILE "$input{'L02'}"; print COMMENTSFILE "$input{'L03'}"; print COMMENTSFILE "$input{'L04'}"; print COMMENTSFILE "$input{'L05'}"; print COMMENTSFILE "$input{'L06'}"; print COMMENTSFILE "$input{'L07'}"; print COMMENTSFILE "$input{'L08'}"; print COMMENTSFILE "$input{'L09'}"; print COMMENTSFILE "$input{'L10'}"; print COMMENTSFILE "$input{'L11'}"; print COMMENTSFILE "$input{'L12'}"; print COMMENTSFILE "$input{'L13'}"; print COMMENTSFILE "$input{'L14'}"; print COMMENTSFILE "$input{'L15'}"; print COMMENTSFILE "$input{'L16'}"; print COMMENTSFILE "$input{'L17'}"; print COMMENTSFILE "$input{'L18'}"; print COMMENTSFILE "$input{'L19'}"; print COMMENTSFILE "$input{'L20'}"; print COMMENTSFILE "$input{'L21'}"; print COMMENTSFILE "$input{'L22'}"; print COMMENTSFILE "$input{'L23'}"; print COMMENTSFILE "$input{'L24'}"; print COMMENTSFILE "$input{'L25'}"; print COMMENTSFILE "$input{'L26'}"; print COMMENTSFILE "$input{'L27'}"; print COMMENTSFILE "$input{'L28'}"; print COMMENTSFILE "$input{'L29'}"; print COMMENTSFILE "$input{'L30'}"; print COMMENTSFILE "$input{'L31'}"; print COMMENTSFILE "$input{'L32'}"; print COMMENTSFILE "$input{'L33'}"; print COMMENTSFILE "$input{'L34'}"; print COMMENTSFILE "$input{'L35'}"; print COMMENTSFILE "$input{'L36'}"; print COMMENTSFILE "$input{'L37'}"; print COMMENTSFILE "$input{'L38'}"; print COMMENTSFILE "$input{'L39'}"; print COMMENTSFILE "$input{'L40'}"; print COMMENTSFILE "$input{'L41'}"; print COMMENTSFILE "$input{'L42'}"; print COMMENTSFILE "$input{'L43'}"; print COMMENTSFILE "$input{'L44'}"; print COMMENTSFILE "$input{'L45'}"; print COMMENTSFILE "$input{'L46'}"; print COMMENTSFILE "$input{'L47'}"; print COMMENTSFILE "$input{'L48'}"; print COMMENTSFILE "$input{'L49'}"; print COMMENTSFILE "$input{'L50'}"; print COMMENTSFILE "$input{'L51'}"; print COMMENTSFILE "$input{'L52'}"; print COMMENTSFILE "$input{'L53'}"; print COMMENTSFILE "$input{'L54'}"; print COMMENTSFILE "$input{'L55'}"; print COMMENTSFILE "$input{'L56'}"; print COMMENTSFILE "$input{'L57'}"; print COMMENTSFILE "$input{'L58'}"; print COMMENTSFILE "$input{'L59'}"; print COMMENTSFILE "$input{'L60'}"; print COMMENTSFILE "$input{'L61'}"; print COMMENTSFILE "$input{'L62'}"; print COMMENTSFILE "$input{'L63'}"; print COMMENTSFILE "$input{'L64'}\n"; close COMMENTSFILE; print < Your Libertarian Purity Test Score

Your Libertarian Purity Score


Your score is...

$total


What Your Score Means

0 points: You are not a libertarian by any stretch of the imagination. You are probably not even a liberal or a conservative. Just some Nazi nut, I guess.

1-5 points: You have a few libertarian notions, but overall you're a statist.

6-15 points: You are starting to have libertarian leanings. Explore them.

16-30 points: You are a soft-core libertarian. With effort, you may harden and become pure.

31-50 points: Your libertarian credentials are obvious. Doubtlessly you will become more extreme as time goes on.

51-90 points: You are a medium-core libertarian, probably self-consciously so. Your friends probably encourage you to quit talking about your views so much.

91-130 points: You have entered the heady realm of hard-core libertarianism. Now doesn't that make you feel worse that you didn't get a perfect score?

131-159 points: You are nearly a perfect libertarian, with a tiny number of blind spots. Think about them, then take the test over again. On the other hand, if you scored this high, you probably have a good libertarian objection to my suggested libertarian answer. :-)

160 points: Perfect! The world needs more like you.


View Analysis of Cumulative Libertarian Purity Results

Click here to learn more about the Libertarian Idea.>

Comments? Send them to me.

Want to see the perl code for the Libertarian Purity Test? Click here

Return to homepage

ENDOFTEXT # Close the document cleanly. print &HtmlBot; } sub PrintForm { print &PrintHeader; # Print out the body of the form from a single quoted here-document # Note that if ENDOFTEXT weren't surrounded by single quotes, # it would be necessary to be more careful with the other text # For example, the @ sign (in the address) would need to be escaped as \@ print <<'ENDOFTEXT'; Libertarian Purity Test

The Libertarian Purity Test
has moved to

http://www.bcaplan.com/cgi/purity.cgi.

You will be automatically dragged there in 3 seconds.

ENDOFTEXT print &HtmlBot; }