Workshop

Quiz

1:Why would name have been an inappropriate search key for the Customer program you wrote in this hour, especially if the customer list were much, much longer?
  1. Combinations of last name and first name would have been more than Perl's hashes would allow.

  2. People's names are not unique keys.

  3. No one would ever want to search a customer database by name.

2:What's the difference between an associative array and a hash?
  1. There is no difference.

  2. Associative arrays are used on more formal data sets, such as billing records.

  3. Hashes aren't really associative arrays in Perl, so they have a different name.

3:What kinds of data are best suited for hashes?
  1. Simple lists of items

  2. Potatoes and corned beef

  3. Lists of key-value pairs

Answers

A1: b. Perl's ...

Get Sams Teach Yourself Perl in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.