{\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;}
{\f39\froman\fcharset238\fprq2 Times New Roman CE{\*\falt Thorndale};}{\f40\froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Thorndale};}{\f42\froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Thorndale};}
{\f43\froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Thorndale};}{\f44\froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Thorndale};}{\f45\froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Thorndale};}
{\f46\froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Thorndale};}{\f55\fmodern\fcharset238\fprq1 Courier New CE;}{\f56\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f58\fmodern\fcharset161\fprq1 Courier New Greek;}
{\f59\fmodern\fcharset162\fprq1 Courier New Tur;}{\f60\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f61\fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f62\fmodern\fcharset186\fprq1 Courier New 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\langnp0\langfenp255 Numbering Symbols;}}{\info
{\author Sharon Tuttle}{\operator CNRS}{\creatim\yr2004\mo8\dy2\hr14\min32}{\revtim\yr2004\mo8\dy26\hr17\min12}{\printim\yr2004\mo8\dy26\hr11\min51}{\version3}{\edmins4}{\nofpages1}{\nofwords343}{\nofchars1956}{\*\company CNRS-HSU}{\nofcharsws0}
{\vern8269}}\margt2093 \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 #1 and Week 1 Lab Exercise\tab \tab p. }{\field{\*\fldinst {\fs16 \\page}}{\fldrslt {\fs16\lang1024\langfe1024\noproof 1}}}{
\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 {\b\fs20 CIS 480 - Perl in Depth - Fall 2004
\par Homework #1 - REVISED VERSION
\par 
\par }\pard \s15\qc \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b\fs20 HW #1 due: Thursday, September 2nd, 12:00 noon
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {\b\fs20 
\par }{\fs20 Reading: Chapters 1-3, "Learning Perl"
\par }{\fs12 ----------------------------------------
\par }{\fs20 Intro to Perl; basics; scalar data; lists and arrays
\par 
\par Please note: the homeworks will not always be this short!
\par }{\b\fs20 
\par }{\fs20 For}{\b\fs20  }{\fs20 EACH of the scripts below, please begin }{\b\fs20 EACH }{\fs20 with the following:}{\b\fs20 
\par 
\par }{\b\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}{\b\fs20\loch\af2 
\par \hich\af0\dbch\af0\loch\f2 ###480-scriptname:}{\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2  }{\i\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2 yourScriptName}{\b\fs20\loch\af2 
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b\fs20 
\par 1.\tab }{\fs20 write a}{\b\fs20  total_with_tax}{\fs20  script. It asks for a pre-tax total, and a tax rate. It prints to the screen what the overall total would be for that amount with that amount of tax added --- BUT prin
t this total so that it is preceded by a dollar sign. ($)
\par }{\b\fs20 
\par 2.\tab }{\fs20 write a }{\b\fs20 dir_info }{\fs20 script for a UNIX-phobic friend. He doesn't want to remember the UNIX }{\b\fs20 ls}{\fs20  command. He wants to be asked for the name of a directory (relative to the current directory), and then the }{
\b\fs20 detailed}{\fs20  listing (ls -l) of the files in that directory should be printed to the screen. Assume for now that the directory name given IS a good name (we'll learn how to check that later...) }{\b\fs20 
\par 
\par    \tab }{\fs20 USEFUL HINT: suppose you wanted to have Perl print the results of a UNIX command such as date to the screen.
\par }\pard \s15\ql \fi-420\li840\ri0\nowidctlpar\aspalpha\faauto\rin0\lin840\itap0 {\fs20 *\tab you'd think that:}{\b\fs20 \tab }{\b\f2\fs20 `date`;}{\b\fs20 
\par }{\b\fs20\loch\af2 \tab }{\fs20 would work. But, it doesn't.}{\b\fs20\loch\af2 
\par }{\b\fs20 
\par }{\fs20 *\tab However, you can use the command as an argument to print, and it DOES work:
\par }{\b\fs20 \tab }{\b\f2\fs20 print `date`;}{\b\fs20 
\par }{\b\fs20\loch\af2 
\par }{\fs20 *\tab And, you can assign the results of the command to a variable and print that, and it DOES work:
\par }{\b\fs20 \tab }{\b\f2\fs20 $result = `date`;}{\b\fs20 
\par }{\b\fs20\loch\af2 \hich\af0\dbch\af0\loch\f2  \tab print "$result";
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b\fs20 
\par 3.\tab }{\fs20 write a }{\b\fs20 find_pos_max }{\fs20 script. It asks for numbers until a negative value is entered --- then it prints the maximum value seen and exits. 
\par }{\b\fs20 
\par }{\fs20 Note that}{\b\fs20  #4, #5}{\fs20 , and }{\b\fs20 #6}{\fs20  are being moved to the next homework... they involve arrays.}{\b\fs20 
\par 
\par }{\fs20 You may choose one of the following options for turning these three scripts in:
\par *\tab You may e-mail them to me using 3 separate e-mails, each with Subjec
t: line containing the name of the script. PLEASE DO NOT SEND THEM AS ATTACHMENTS --- remember, you can use ^R within your properly-configured pine on cs-server to copy a file's contents reliably into an e-mail message.
\par OR}{\b\fs20 
\par }{\fs20 *\tab You may copy the contents of all 3 scripts into a single e-mail message with Subject: }{\b\fs20 480 hw 1}{\fs20 
. Again,  PLEASE DO NOT SEND THEM AS ATTACHMENTS --- just ^R each file one after the other (in the order they are given above, please!) within a single e-mail message.}{
\par }}