Convert hash values to list

S

Shea Martin

Is there a canned method converting a hash to a list of values. i.e.,

@v = values( %myhash );
@k = keys( %myhash );

BTW - I know how to do it with a loop, just wondering if there was a
builtin...

Thanks,

~S
 
S

Shea Martin

Shea said:
Is there a canned method converting a hash to a list of values. i.e.,

@v = values( %myhash );
@k = keys( %myhash );

BTW - I know how to do it with a loop, just wondering if there was a
builtin...

Thanks,

~S

I found the answer. Man looked for about 10 mins on google, with
nothing, usually that means it doesn't exist. I just found the answer on
page 138 of Perl in a Nutshell.

Note to self, RTF! :)

~S
 
P

Paul Lalli

I'm confused as to what you're looking for. How does the first
statement above not do what you want?
I found the answer.

Could you possibly post the answer you found (along with a
clarification of the question), to better aide those who might have a
similar question in the future?
Man looked for about 10 mins on google, with
nothing, usually that means it doesn't exist. I just found the answer on
page 138 of Perl in a Nutshell.

Note to self, RTF! :)

The docs that come with Perl (perldoc) and books specifically written
about Perl (the Camel, Llama, Cookbook, and Nutshell) are generally
more likely to get you answers you're looking for than random webpages
returned by Google.

Paul Lalli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top