Scripts and Utilities -- Perl lab



Write the following programs as perl programs. Read the entire lecture notes before starting. All information that you need is contained in the lecture notes somewhere.

Note you should not use pipes in your programs. Do it all within one process.

Do number 1 and 2. Choose between number 3 and 4.

  1. square from the awk lab. This should take less than a minute.
  2. unhtml from the sed lab. This should also take less than a minute.
  3. calcavg from the awk lab.
  4. golf from the awk lab.
Other programs you should try if you want to do more. These will not count nor will they be graded. They are simply for your edification if you want to do more.
  1. fixit from the sed lab. You may want to use the tr feature for some of this. Note that the ability to ignore case is a godsend here.
  2. unhtml again, but this time have it work on html tags that span lines. You may have to read the man page on pattern matching strings that contain newlines.
  3. mail_strip from the sed lab.
  4. ckpproc from the awk lab.