viktor has asked for the wisdom of the Perl Monks concerning the following question:
I have a hash table like this rat=>"acggghhh" mat=>"dhhdhdhdh" rat=>"fhhfjfjj" rat=>"dggdgdgdg" I want to take this into a hash and wants my same key to contain the different values together (e.g. rat=acggghhhfhhfjfjjdggdgdgdg mat=dhhdhdhdh) how can i do these I wrote the code but it is not working
#!/usr/bin/perl -w use strict; my ($key,$value); my %hash=(rat=>"acggghhh", mat=>"dhhdhdhdh", rat=>"fhhfjfjj", rat=>"dggdgdgdg"); while(($key,$value)=each %hash){ print "$key and $value \n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: question related to hash
by choroba (Cardinal) on Jun 24, 2011 at 10:29 UTC | |
by Anonymous Monk on Jun 24, 2011 at 10:42 UTC | |
|
Re: question related to hash
by johngg (Canon) on Jun 24, 2011 at 15:50 UTC | |
|
Re: question related to hash
by Anonymous Monk on Jun 24, 2011 at 10:29 UTC | |
by aanriot (Sexton) on Jun 24, 2011 at 11:19 UTC |