No, but you can make the one value for a key be a reference to an array which contains multiple values.

$h{key} = [ 'value1', 'value2' ]; push @{ $h{key} }, 'value3', 'value4'; # $h{key}->[2] eq 'value3' # ${ $h{key} }[3] eq 'value4'

If you're not familiar with array references, see perlreftut for a start.

You can also make the one value for a key be a string that encodes all the various values (e.g., CSV or Data::Dumper output, etc.)


In reply to Re: multiple values for one key in hash by kyle
in thread multiple values for one key in hash by sovixi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":