At 03:15 PM 08/08/2001 -0700, Sofia wrote:
>I have the following hash of first names and last
>names:
>
>%hash = (
>   joe => "smith",
>   jim => "jones",
>   sof => "comes",
>);
>
>If for example, jim now has two last names ie jones
>taylor, how do I represent that on the hash?

You'd basically want to create a hash of arrays.

So instead of having each key pointing to a single scalar value, you'd make
it so each key points to an anonymous array instead. So the hash would look
like this:

%hash = (
   joe => "smith",
   jim => ["jones", "taylor"],
   sof => "comes",
);

Then youd access the values like this:

$hash{jim}[0] # returns "jones"
$hash{jim}[1]; # returns "taylor"

hope this helps. Aloha,
mel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to