Perl in-class exam

This exam tests your ability to design relatively valuable Perl scripts in limited time and under pressure. Please develop a script named exam.pl that satisfies the following requirements:
  1. Script treats arguments of the command line as file names. At least one argument should be provided. If there is no argument given, the scripts prints an error message and terminates.
  2. For each file name given as script argument the script should test if the file exists and if it is a file (not a directory or anything else).
  3. Once the file is tested and successfully opened the script should search for all words that start with the letter "T" (lower or upper case) and have either letter "a" or letter "e". For example, it should find words that or The, but not master or this.
  4. Inside the script you should count how many times each word that meets the requirements occurs and store the results into a hash.
  5. After reading each file the script should print the file name and the contents of the hash; that is, you should print how many times each word appeared in this file. Words must be sorted by their frequencies. Please note that you count words separately in each file. For example, the output would look like:
    ...> perl exam.pl test.txt data.txt system
    test.txt :
     theology - 15
     That     - 10
     the      - 4
    data.txt :
     that     - 7
     tech     - 4
     teacher  - 1
    system : is not a file
    

This exam is due by 3:30pm on Thursday, February 26, 2004. Please store the file in your perl directory on the ist.marshall.edu server. Please also send me an e-mail upon completing the assignment. I would appreciate if you include the name of the files for projects 1 and 2 (they also have to be stored on the server).