Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to print key and value of hash in a list

by spazm (Monk)
on May 22, 2011 at 22:07 UTC ( [id://906207]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %hash = ( a=>1, b=>2, c=>3);
    my @v = values %hash;  #  e.g. ( 2,   3,   1 )
    my @k = keys   %hash;  #  e.g. ('b', 'c', 'a')
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://906207]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-26 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found