Lab Exercise #3
Lab Exercise 3 : Arrays to Hashes to Movies


Purpose: Practice the creation and use of hashes.

Write a program that does the following:

   1. Put the following arrays in your program:
      The following arrays have a one to one correlation to each other. Meaning element 3 in the @imdb_id array corresponds to element 3 in the @directors array.

my @imdb_id = ("0120611", "0106308", "0088247", "0267804",
            "0094074",
            "0102798", "0120382",
            "0196229", "0272152", "0109830");
            
my @movietitles = ("Blade", "Army of Darkness", "The Terminator", "The One", 
			 "Superman IV: The Quest for Peace", 
			 "Robin Hood : Prince of Thieves", "The Truman Show", 
			 "Zoolander", "K-Pax", "Forrest Gump");
                
my @directors = ("Stephen Norrington", "Sam Raimi", "James Cameron", "James Wong (IV)",
		    "Sidney J. Furie",
		    "Kevin Reynolds (I)", "Peter Weir",
		    "Ben Stiller", "Iain Softley", "Robert Zemeckis");

my @leadstars = ("Wesley Snipes", "Bruce Campbell (I)", "Arnold Schwarzenegger", "Jet Li",
		    "Christopher Reeve",
		    "Kevin Costner", "Jim Carrey",
		    "Ben Stiller", "Kevin Spacey", "Tom Hanks");

my @releaseyears = ("1998", "1993", "1984", "2001",
                 "1987",
                 "1991", "1998",
                 "2001", "2001", "1994");

   2. Convert the arrays to a hash of hashes.
      The parent hash key name should be the @imdb_id number value. The value of the imdb_id hash key should be another hash that has movietitles, directors, leadstars and releaseyears keys. The key names for the inner hash should be the singular name of the above arrays, meaning the key name for movietitles should be movietitle with the correct corresponding value.


   3. Once your hash of hashes has been created DO NOT refer to or use the original arrays again. This also means don't use the original arrays for the extra credit.


   4. From the standard input let the user type in the following commands.
      The program should keep asking the user for a command to be entered and respond to the following commands:

      If the user types "exit" and the enter key the programs exits.

      If the user types "list" and the enter key then the program lists all the the movie information for all the movies in the hash you created.
      (including the imdb number).

      If the user types an imdb number from the array. (for example 0106308). Then the program should display all the information about the movie that we have.

      If the inputed imdb number can not be found in the hash then the program should alert the user that either the user entered invalid input or that the imdb_id does not exist in the hash.

   5. Extra Credit: Without creating a new hash, sort the list of movies outputed from the "list" command in alphabetical order using the sort function. 
