in reply to Re^3: Hashes, keys and multiple histogram
in thread Hashes, keys and multiple histogram

If you have a hash of hashes (and not array of hashes) such as the one I showed in my second version of the program, you can use the code you showed (which finds the union, rather than the intersection, of two sets, i.e. a list of unique keys present in both sets) making the following small changes (I think it should be right, but I cannot test right now):
my %seen = (); for my $element (keys(%{$hist{1}}), keys(%{$hist{2}})) { $seen{$element}++; } my @uniq = keys %seen;
Having said that, we might have another serious problem here. 12 GB is a lot of data, it is far from being sure that such huge volumes of data will fit into your computer memory. In other words, you might not be able to store all your data into a hash. I am not talking of a Perl limitation, but of a limitation of your hardware.

Replies are listed 'Best First'.
Re^5: Hashes, keys and multiple histogram
by f77coder (Beadle) on Aug 19, 2014 at 15:49 UTC

    Laurent,

    Many thanks for the help, I'm running some benchmarks now.