{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Thorndale};}{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
{\f29\fswiss\fcharset128\fprq2{\*\panose 020b0604020202020204}Arial Unicode MS;}{\f30\fswiss\fcharset128\fprq2 @Arial Unicode MS;}{\f31\froman\fcharset238\fprq2 Times New Roman CE{\*\falt Thorndale};}
{\f32\froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Thorndale};}{\f34\froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Thorndale};}{\f35\froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Thorndale};}
{\f36\froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Thorndale};}{\f37\froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Thorndale};}{\f38\froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Thorndale};}
{\f47\fmodern\fcharset238\fprq1 Courier New CE;}{\f48\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f50\fmodern\fcharset161\fprq1 Courier New Greek;}{\f51\fmodern\fcharset162\fprq1 Courier New Tur;}{\f52\fmodern\fcharset177\fprq1 Courier New (Hebrew);}
{\f53\fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f54\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f265\fswiss\fcharset0\fprq2 Arial Unicode MS Western;}{\f263\fswiss\fcharset238\fprq2 Arial Unicode MS CE;}
{\f264\fswiss\fcharset204\fprq2 Arial Unicode MS Cyr;}{\f266\fswiss\fcharset161\fprq2 Arial Unicode MS Greek;}{\f267\fswiss\fcharset162\fprq2 Arial Unicode MS Tur;}{\f268\fswiss\fcharset177\fprq2 Arial Unicode MS (Hebrew);}
{\f269\fswiss\fcharset178\fprq2 Arial Unicode MS (Arabic);}{\f270\fswiss\fcharset186\fprq2 Arial Unicode MS Baltic;}{\f273\fswiss\fcharset0\fprq2 @Arial Unicode MS Western;}{\f271\fswiss\fcharset238\fprq2 @Arial Unicode MS CE;}
{\f272\fswiss\fcharset204\fprq2 @Arial Unicode MS Cyr;}{\f274\fswiss\fcharset161\fprq2 @Arial Unicode MS Greek;}{\f275\fswiss\fcharset162\fprq2 @Arial Unicode MS Tur;}{\f276\fswiss\fcharset177\fprq2 @Arial Unicode MS (Hebrew);}
{\f277\fswiss\fcharset178\fprq2 @Arial Unicode MS (Arabic);}{\f278\fswiss\fcharset186\fprq2 @Arial Unicode MS Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;
\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{
\s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs24\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \snext15 Default;}{\s16\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 
\fs24\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext16 header;}{\*\cs17 \additive \fs24\cf1\lang0\langfe255\langfenp255 Numbering Symbols;}}{\info{\author Sharon Tuttle}{\operator CNRS}{\creatim\yr2004\mo8\dy2\hr14\min32}
{\revtim\yr2004\mo10\dy28\hr11\min54}{\printim\yr2004\mo9\dy9\hr10\min40}{\version3}{\edmins2}{\nofpages3}{\nofwords830}{\nofchars4733}{\*\company CNRS-HSU}{\nofcharsws5812}{\vern8269}}\margt2079 
\deftab1250\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl \fet0\sectd 
\sbknone\linex0\headery1440\sectdefaultcl {\header \pard\plain \s16\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 \fs24\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 {\fs16 
CIS 480 -  Homework #3 and Week 3 Lab Exercise \tab \tab p. }{\field{\*\fldinst {\fs16 \\page}}{\fldrslt {\fs16\lang1024\langfe1024\noproof 3}}}{
\par }{\fs16 Fall 2004
\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}
{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s15\qc \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\fs24\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 {\fs22 CIS 480 - Perl in Depth - Fall 2004
\par WEEK 10 LAB EXERCISE and Homework #8
\par 
\par week 10 lab exercise due: Thursday,  October 28th, END of lab
\par }\pard \s15\qc \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\fs22 HW #8 due: Thursday, November 4th, 12:00 noon
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {\b\fs22 ---------------------------------------------------------------------------------------------------------
\par For EACH of the scripts below (lab exercise AND homework), you are required to begin EACH with the following:
\par }{\b\fs20 
\par }{\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 #!/usr/bin/perl -w
\par \hich\af0\dbch\af0\loch\f2 ###480-author: }{\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 yourLastName}{\fs20\loch\af2 
\par \hich\af0\dbch\af0\loch\f2 ###480-scriptname:\hich\af0\dbch\af0\loch\f2  }{\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 yourScriptName}{\fs20\loch\af2 
\par }{\b\i\fs20\loch\af2 
\par }{\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 (}{\i\fs28\loch\af2 \hich\af0\dbch\af0\loch\f2 THEN}{\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2  an }{\i\fs20\ul\loch\af2 \hich\af0\dbch\af0\loch\f2 opening comment block }{\i\fs20\loch\af2 
\hich\af0\dbch\af0\loch\f2 containing the NAME of the script file, your name, the date, and a brief description of the purpose of this script)
\par 
\par }{\fs22 Note that the spacing and header need to be exact --- I hope to develop a Perl script to process these in some interesting and useful fashion. More on that as it develops.
\par }{\b\fs22 --------------------------------------------------------------------------------------------------------
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b\fs22\ul WEEK 10 LAB EXERCISE
\par }{\b\fs20\ul 
\par }\pard \s15\ql \fi-435\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b\fs22 1.\tab }{\fs22 
You need to add links to your 480perl.html page on sorrel. It is required that the new section given below be placed BEFORE the section for the Week 9 Lab Exercise; putting new material near the TOP of a page makes it easier for 
a reader to tell when an update has been made.
\par 
\par \tab So, add the following segment of code BEFORE the Week 9 Lab Exercise section (and directly after the first }{\f2\fs20 <ul>}{\fs22 ):
\par }{\b\fs22 
\par }{\b\fs20\loch\af2 \tab \hich\af0\dbch\af0\loch\f2 <li> HW #8
\par \tab \hich\af0\dbch\af0\loch\f2      <ul>
\par \tab \hich\af0\dbch\af0\loch\f2      <li> <a href="pref_both1.html"> pref_both1 </a>
\par \hich\af0\dbch\af0\loch\f2  \tab      </ul>
\par \tab \hich\af0\dbch\af0\loch\f2 <br>
\par 
\par }{\b\fs22 \tab }{\b\f2\fs20 <li> Week 10 Lab Exercise}{\b\fs22 
\par }{\b\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2         <ul>
\par \hich\af0\dbch\af0\loch\f2         <li> <a href="lab10_1.html"> lab10_1 </a>
\par \hich\af0\dbch\af0\loch\f2    \tab     </ul>
\par \tab \hich\af0\dbch\af0\loch\f2 <br>
\par }{\b\fs22 \tab 
\par 2.\tab }{\fs22 Now, consider: one can create radio buttons using the following HTML:
\par }{\b\fs22 
\par \tab }{\b\f2\fs20 <br><br> }{\b\fs22 
\par }{\b\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2     <input type=radio 
\par \hich\af0\dbch\af0\loch\f2            name=}{\b\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 choice_categor\hich\af0\dbch\af0\loch\f2 y}{\b\fs20\loch\af2 
\par \hich\af0\dbch\af0\loch\f2            value=}{\b\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 this_choice}{\b\fs20\loch\af2 
\par \hich\af0\dbch\af0\loch\f2            size}{\b\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 =desired_size}{\b\fs20\loch\af2 
\par }{\b\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2            }{\b\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 checked}{\b\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 >}{\b\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2  
\par \hich\af0\dbch\af0\loch\f2     }{\b\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 this choice nicely expressed}{\b\fs20\loch\af2 
\par }{\b\fs22 \tab 
\par \tab }{\fs22 This will show the radio button, then the nicely-expressed text of this choice. 
\par 
\par \tab Because "checked" is included here, this option will initially be selected. Note that it is considered good style to explicitly indicate exactly one of your radio button choices as "checked".
\par 
\par \tab It is important to note that all inputs of type radio with this }{\i\fs22 choice_category}{\fs22 
 will be considered to be part of the radio button "set" --- only one of them will be permitted to be chosen at a time. When the form containing this is submitted, the }{\i\fs22 choice_category}{\fs22  parameter will have the value of the }{\i\fs22 
this_choice }{\fs22 radio button that is selected.
\par 
\par \tab See lab10_play1.html, linked from the course web page, for an example that includes 2 radio buttons harold and maude, the choice of which becomes the value of radio1. 
\par }{\b\fs22 
\par 3.\tab }{\fs22 So: consider your }{\b\fs22 lab09_2.html}{\fs22  from last week. Modify it to create}{\b\fs22  lab10_1.html}{\fs22   which:}{\b\fs22 
\par }\pard \s15\ql \fi-435\li855\ri0\nowidctlpar\aspalpha\faauto\rin0\lin855\itap0 {\fs22 *\tab still includes your name, and
\par 
\par *\tab  includes at least three radio buttons making up single radio button "set", with exactly one initially, explicitly checked.
\par 
\par }\pard \s15\ql \fi-435\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\fs22 \tab When the submit button is pressed,}{\b\fs22  lab10_1.pl}{\fs22  should be called to print a simple web page back to the browser that:}{\b\fs22 
\par }\pard \s15\ql \fi-435\li870\ri0\nowidctlpar\aspalpha\faauto\rin0\lin870\itap0 {\fs22 *\tab also includes your name within the body of the page, and
\par }{\b\fs22 
\par }{\fs22 *\tab prints the radio value selected.}{\b\fs22 
\par }\pard \s15\ql \fi-435\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b\fs22 
\par }{\tab (Note: you can make this more elaborate if you'd like, although that is not required! 8-) )
\par }{\b\fs22 
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {\fs22 When you believe lab10_1.html and
 lab10_1.pl are working, add your name to the "NEXT" list on the board. When it is your turn, I will come and try your script starting from your name link on the page }{\b\fs22 http://www.humboldt.edu/~st10/f04cis480perl/480student_pages.html}{\fs22 
. If, by the end of lab, it runs from there and meets the above specifications, then you will have met the requirements for this lab exercise.
\par }\pard \s15\ql \fi-435\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b\fs22 
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b\fs22\ul HOMEWORK #8
\par 
\par }{\b 1.\tab }{When we last left }{\b pref_count2}{, it used DBM file(s) to support counting of votes on some topic. It looked to see if the expected DBM}{
 file(s) existed (and created,  "seeded", and closed them if not with the help of a subroutine), printed a menu of choices to the screen, solicited a choice from the user (and made sure it was a valid choice), updated the vote tallies 
to reflect that choice, and thanked the user for that vote (and told him/her how many others, so far, had voted likewise). And, }{\b pref_results2}{ simply printed to the screen the votes-so-far for all of the options.  
\par 
\par \tab Well, this is certainly ripe for webification...
\par 
\par \tab Create }{\b pref_both1.html}{ and }{\b pref_both1.pl }{on sorrel. }{\b pref_both1.html}{ should:
\par 
\par }\pard \s15\ql \fi-420\li825\ri0\nowidctlpar\aspalpha\faauto\rin0\lin825\itap0 {*\tab include your name within the body of the web page
\par *\tab set up a "set" of radio buttons for the options the user is to choose from
\par *\tab include a check box the user can check if he/she would like to see the vote-totals so far
\par *\tab call }{\b pref_both1.pl}{ when the Submit button is pushed
\par 
\par }{\b pref_both1.pl}{ should then:}{\b 
\par }{
\par *\tab call the same subroutine as before to create the DBM file(s) if they are found to not exist;
\par *\tab update the voting tallies to reflect the chosen radio button,
\par *\tab print back an HTML page that:
\par }\pard \s15\ql \fi-420\li1275\ri0\nowidctlpar\aspalpha\faauto\rin0\lin1275\itap0 {*\tab includes your name in the body of the page
\par *\tab thanks the user for his/her vote, including what he/she voted for and the total votes so far for that option
\par *\tab also prints the vote-totals-so-far for all options IF the check box has been checked
\par }\pard \s15\ql \fi-420\li1695\ri0\nowidctlpar\aspalpha\faauto\rin0\lin1695\itap0 {*\tab (I'll not be picky about the format of this at this time, as long as it is reasonably readable. BUT they should be ordered from highest-vote-getter to lowest-v
ote-getter,  in ASCIIbetical order of option for those with the same vote total. Remember that <br> forces a line break in HTML... 8-) ).
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {
\par \tab When you are done, make sure that the}{\b  pref_both1 }{link from }{\b 480perl.html }{(set up in the week 10 lab exercise) does indeed successfully run }{\b pref_both1.}{ Make sure that }{\b pref_both1.pl}{
 is NOT world-readable (711 should make it executable but not readable.) }{
\par }{\b\fs22 
\par \tab }{\fs22 And, read both files into a single e-mail message with the}{\b\fs22  Subject 480 hw 8}{\fs22 , and e-mail them, NOT as attachments, to }{\b\fs22 st10@humboldt.edu }{\fs22 by the due date and time given above}{\b\fs22 .
\par 
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {\b\fs20 
\par }}