hwkPerl2

  < Previous  Next >

Due Date

See the calendar for due date.

Description:

For this assignment write the following Perl programs:
  1. A program (regex.pl) that switches "lastname,<whitespace>firstname" for "firstnameTAB-CHARACTERlastname" for all the appropriate lines in names.txt (output should look like names-final.tab).
  2. Make a Perl package that represents an object of your choice that has two or more variables. Write a Perl script that calls new to make an object from your package. Additionally, call an accessor method and a mutator method on your object. Name your Perl script oop.pl.
  3. Write a Perl CGI script that asks for a mathematical expression and executes it using either bc or dc. Copy your CGI script to the ~/public_html/calculator.cgi directory on ranger in your CS Account and test it out.
    Treat all input as tainted. Untaint it.
  4. Download all of the slides from the this Perl course (under Places to go from here: ... Course Slides (download)). Write a Perl script (allSlides.pl) that combines all of those webpages in sequential order to a single concise (but long) webpage (by stripping out the headers and footers, etc). Start with welcome.html, then go to contents.html, etc. Name your combined webpage allSlides.html. As an example, see the file all_slides.html in the download.
For each script, add comments before subroutines, major portions of your code, etc. Good programming style is to start with JUST comments, then go back and add it the code.
Make a bash script, runAll.sh that executes all of the above Perl scripts and has the command:

open http://www.cs.mtsu.edu/~username/calculator.cgi

where username is your username.
Compress your bash and Perl scripts and a report detailing any troubles with this assignment with either tar or zip.

Rubric:

Points      Item
----------  --------------------------------------------------------------
_____ / 12  regex.pl
_____ / 20  oop.pl
_____ / 24  calculator.cgi
_____ / 40  allSlides.pl
_____ / 10  Comments in code
_____ /  4  Report (detailing any troubles and a completed rubric)

_____ /110  Total

_____  Approximate number of hours spent
      

Submission

Compress your bash and Perl scripts and report with either tar or zip and submit your compressed file into the appropriate folder in the dropbox for COMS 6100 at https://elearn.mtsu.edu. To make a tarball, do something like the following:
tar -czf hwkPerl2-USER.tar.gz  hwkPerl2-USER/*.pl
To use zip, do something like the following:
zip -r hwkPerl2-USER.zip  hwkPerl2-USER/*.pl