dmux
dmux

Reputation: 442

Creating an array reference to hash values

Is it possible to return a hash's values as an array reference?

\@{values %hash}

I looked over the perlref document, but didn't see anything relating to this (or if I did, I wasn't able to relate it to my question).

Upvotes: 2

Views: 152

Answers (1)

mu is too short
mu is too short

Reputation: 434615

I think you're looking for this:

my $values_ref = [ values %hash ];

Upvotes: 7

Related Questions