in reply to Extract the common values in hash of array with double keys
would like to know whether it is working or not.Only you know if your code is working the way you want it to work. I don't follow your description of your requirements. That being said, the following looks suspicious:
Your data structure is a hash of hashes of ... scalar references. Did you really want a hash of hashes of arrays?my ($id, $sum, $haploStr) = split ('\t',$_); push @{$data{$id}{$sum}}, \$haploStr;
Use Data::Dumper after your while loop to get a better idea of what I'm taking about:my ($id, $sum, @haploStr) = split ('\t',$_); push @{$data{$id}{$sum}}, \@haploStr;
print Dumper(\%data);
I am using "undef" to remove the pattern which is matching (while iterating -- which I think is not good way of programing,I agree that using undef seems unconventional here. Perhaps you want to delete?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extract the common values in hash of array with double keys
by snape (Pilgrim) on Feb 04, 2010 at 19:53 UTC | |
by jethro (Monsignor) on Feb 04, 2010 at 20:38 UTC |