...
I know (keys %cnter) is the title part.
(keys %{cnter{$section}}) is each word in the title hash. Not sure where to start. If I do this:
(keys %{cnter{$section}}) eq (keys %{cnter{$section}})
I am only comparing the words in the section. I believe I need to assign each section a unique hash name so that it would look something like this:
(keys %{cnter1{$section}}) eq (keys %{cnter2{$section}})
...
Hi,
Its a good idea to have two or three sections, if you have two or three sections only(not more than that). But if sections in the input file is more than 3(may be 5 or 10) then having unique hash for each sections is not a good idea. So we can change a little bit in the way data is stored in the hash, so that it is easy to handle.
Now the data is stored in the hash is like this,
cnter{
section1 => {
word1 => count1,
word2 => count2
},
section2 => {
word1 => count1,
word2 => count2
},
...
}
we will alter above hash, so that we will have one hash for entire section,
cnter{
word1 => [sec1_count, sec2_count, sec3_count....],
word2 => [sec1_count, sec2_count, sec3_count....],
...
}
Now only word is stored as KEY and VALUE is an anonymous array holding count of word in each section.
Note: Each index in the array is dedicated to perticular section, so word count should be incremented accordingly.
katharnakh.