in reply to Tallying co-occurence of numbers
And then thought to use a multi-dimensional hash:
If you have a very large number of lines, using multi-dimensional hashes can consume prodigious amount of memory.
You can achieve the same thing using a single level hash by combining the values into a composite key.
I don't quite follow your criteria for producing your output from the input, but basically rather than the multi-level hash you've shown, do:
my %count; ++$count{ join $;, sort{ $a <=> %b } $F2[1], $F2[2], $F3[2] };
$; Is a global who values is a control character that won't show up in normal text; and by sorting your values (you may only want to sort two of them rather than all three) you deal with the reversed duplicates problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tallying co-occurence of numbers
by K_Edw (Beadle) on Jun 17, 2016 at 20:02 UTC | |
by BrowserUk (Patriarch) on Jun 17, 2016 at 20:28 UTC | |
by K_Edw (Beadle) on Jun 18, 2016 at 09:38 UTC | |
by BrowserUk (Patriarch) on Jun 18, 2016 at 10:02 UTC | |
by BrowserUk (Patriarch) on Jun 18, 2016 at 15:51 UTC |