#!/usr/local/bin/perl use strict; use CGI; #check if this is a response or an initial load of the page if ($ENV{CONTENT_LENGTH} > 0) { my $responses; #using POST, because there's a lot of data read(STDIN, $responses, $ENV{CONTENT_LENGTH}); my $query = CGI->new($responses); my $stamp = time; open F, ">>/var/www/html/linguistics/cgi-bin/mhresults.txt"; #keep track of results using a timestamp print F scalar localtime, "\n"; foreach my $key ($query->param()) { my $str = $query->param($key); print F "$key = $str\n"; } close F; #print a thank you message print "Content-type: text/html\n\n"; print "Thank you!\n"; print "

Thank you!

"; exit; } #parse nonsense forms from data at end of code my @words; while (my $line = ) { next if $line =~ /^:/; chomp $line; push @words, split(/\t/, $line); } #randomize nonsense forms my @randwords; while (@words > 0) { my $n = rand @words; push @randwords, $words[$n]; splice @words, $n, 1; } #print first part of header (note that this includes client-side javascript to #insure that subjects answer all questions. print< An experiment

An experiment

For each of the following made up words, indicate how well-formed or typical you think it sounds as a word of English on a scale of 1 to 7 (1 = "very well-formed"; 7 = "very ill-formed". You need to give a response to each question. Don't forget to click the "submit" button when you are done.

HEAD2 #print native speaker check print "
Are you a native speaker of English?\n"; print "yes \n"; print "no \n
\n"; #print items; these go in a big table so the tabbing looks good. print ""; foreach my $word (@randwords) { #extra spaces to separate the columns print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "
$word   (best) 1234567(worst)
"; #print the end of the form/html print<

Mike Hammond TAIL #old-fashioned inclusion of data in code.... __DATA__ :Isolates drolf greltch prunth shrupt smisp stolf threlth zinth drusp gwesht shandge slesk snulp swesk throndge glemp krenth shresp slontch spulsh swust trinth :Near Misses binth drilf glump misp shadge slintch spulp thrilth blemp drisp greld nulp shan slisk spulse thrindge blesk droff grell pinth shendge slisp spust thrond breltch drosp grelm plemp shesp slon stelf thronn brelth drump grentch plunth shindge slotch stilf thrupt brenth drup gresht presp shinth slulp stoff thrusp bresp drupt gresp printh shondge sluntch stulf tolf brondge drusk gretch prolf shrapt slusk stulp treltch brunth druss griltch prundge shremp slust stust trenth clemp drust grinth prunt shrep smimp sulp tresp clenth dusp grolf pruntch shrept smip sulsh trilth clontch dwesht grondge prupt shress smiss sweck trin cren dwesk grunth punth shrest smist swelk trindge crend finth grupt quenth shript smust swesht trintch crendge flemp grusp reltch shrisp snalp swess trith crent flesk qweft relth shruct snisp swest trolf crentch flontch qwelt renth shruft snulf swisk trupt cresp freltch qwept resp shrunt snulk swisp trusp creth frenth gwesh rinth shrup snull swist twinth crinth frinth gwet rolf shrust snult swontch wesht crondge frondge hinth rondge shrut snump swuft wesk crunth frunth inth rupt shundge snup swunt winth crupt frupt jinth rusp sinth snust swupt wust crusp frusp kenth sandge sisp solf swutt yinth dinth geltch kinth scolf skisp sontch threll zilth dolf gemp kwesk scontch sleck spelsh threlm zin drelf gesht lemp sculp slemp spesk threlsh zindge dreltch glem lesk sculsh slentch spuldge threlt zint drenth glep linth scust sless spulk threth zintch dresp glimp minth sesk slest