#! /usr/local/bin/perl chdir "/u1/grad/jaf/Classes/4.208-6.891/WWW"; do 'cgi-hacks.pl'; &find_form_args('name|nickname|course|year|email|url|learn|graphics|calculus|diffeq|linear|physics|sgi|cp|c|gl|mm|me|tm|te|wm|we|hm|he|fm|fe|credit|picture'); ######################################################### # do some basic error checking # &cgidie ('You forgot to specify your name!') if "$name" eq ''; &cgidie ('You forgot to specify the name you prefer to be called!') if "$nickname" eq ''; &cgidie ('You forgot to specify your email address!') if "$email" eq ''; &cgidie ('You forgot to specify where your picture is!') if "$picture" eq ''; #&cgidie ('I can\'t find your picture!') if (! -r $picture); #also test to see if the email address is valid #system("cp $picture /com/doc/web/people/jpmellor/6.837/$email.gif"); #chmod("0664, /com/web/docs/people/jpmellor/6.837/$email.gif"); #chown("6635, 11, /com/web/docs/people/jpmellor/6.837/$email.gif"); ######################################################### # write out the data # # # fix formattting on a few fields # $name =~s/\n/\013/g; # change newline to ^K (vert. tab) $name =~s/\t/\040/g; # change a tab to a space # # # now open and write # open(PENDING, ">./Data/$email") || die "Can't open file: ./data/$email\n"; print PENDING "full name: $name\n"; print PENDING "prefered name: $nickname\n"; print PENDING "course: $course\n"; print PENDING "year: $year\n"; print PENDING "email: $email\n"; print PENDING "url: $url\n"; print PENDING "graphics: $graphics\n"; print PENDING "calculus: $calculus\n"; print PENDING "diffeq: $diffeq\n"; print PENDING "linear: $linear\n"; print PENDING "physics: $physics\n"; print PENDING "sgi: $sgi\n"; print PENDING "c++: $cp\n"; print PENDING "c: $c\n"; print PENDING "gl: $gl\n"; print PENDING "monday morning: $mm\n"; print PENDING "monday evening: $me\n"; print PENDING "tuesday morning: $tm\n"; print PENDING "tuesday evening: $te\n"; print PENDING "wednesday morning: $wm\n"; print PENDING "wednesday evening: $we\n"; print PENDING "thursday morning: $hm\n"; print PENDING "thursday evening: $he\n"; print PENDING "friday morning: $fm\n"; print PENDING "friday evening: $fe\n"; print PENDING "credit: $credit\n"; print PENDING "picture: $picture\n"; print PENDING "learn: $learn\n"; close PENDING;