1. Write a statement that creates an anonymous hash table with the key/value pairs "city"/"Knoxville", "state"/"TN", and "zipcode"/37920. Assign the result to a reference named address (put the appropriate character prefix in front of address).

  2. White a Perl statement that retrieves the value of a widget named age from a CGI form and assigns it to the scalar variable $age.

  3. Name two client-side ways to save state information during a user session on the Web.

  4. Write a Perl statement that transmits a cookie named $age to client browser.

solutions

  1. $address = { "city" => "Knoxville", "state" => "TN", "zipcode" => 37920 };
  2. $age = param("age");
  3. hidden fields and cookies
  4. print header(-cookie => $age);