Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by nvivek (Vicar)
on May 23, 2011 at 04:43 UTC ( #906236=note: print w/replies, xml ) Need Help??


in reply to How to print key and value of hash in a list

You can also print the keys and values of a hash in the following way.
my %hash = ( '1' => 'One', '2' => 'Two', '3' => 'Three', + ); print "Key: $_ and Value: $hash{$_}\n" foreach (keys%hash);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://906236]
help
Chatterbox?
[LanX]: shmem: but only because it is taught in school
LanX remembers one curriculum about benny and the punishment whe we didn't laugh ...hill

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-04-27 20:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (513 votes). Check out past polls.