11.2.3. Discussion
You can only store scalar values in a hash. References, however, are
scalars. This solves the problem of storing multiple values for one
key by making $hash{$key} a reference to an array
containing the values for $key. Normal hash
operations acting on individual scalar values (insertion, deletion,
iteration, and testing for existence) are now written with array
operations acting on lists of values (like push,
splice, and foreach).
Here's how to give a key many values:
$hash{"a key"} = [ 3, 4, 5 ]; # anonymous array
Once you have a key with many values, here's how to use them:
@values = @{ $hash{"a key"} };
To append a new value to the array of values associated with a
particular key, use push:
push @{ $hash{"a key"} }, $value;