[prev] [index] [next]

Exercise: track enrolments

Consider a collection of compressed files of format

Course|StuId|Name|...

Each file has name like 2007s1_COMP.gz, i.e.

YearSession_Prefix.gz

Write a Perl script track.pl that gives enrolment counts

  • example of usage perl track.pl COMP3311 s1
  • session code is optional (can be either s1 or s2)
  • uses all files matching Prefix (e.g. COMP)
  • does sensible error checking/reporting
Develop this by transforming the track shell script.