in reply to Re: perl to add results of 2 arrays from 2 files together.
in thread perl to add results of 2 arrays from 2 files together.

can you merge hashes fron 2 different files?
  • Comment on Re^2: perl to add results of 2 arrays from 2 files together.

Replies are listed 'Best First'.
Re^3: perl to add results of 2 arrays from 2 files together.
by AppleFritter (Vicar) on Aug 26, 2014 at 15:35 UTC
    Yes. The hashes' data resides in memory; where it came from originally is irrelevant.
Re^3: perl to add results of 2 arrays from 2 files together.
by Laurent_R (Canon) on Aug 26, 2014 at 17:47 UTC
    You actually don't even need to merge hashes if you consider that you can do the whole thing with one single hash. Just read the first file, store the values in a hash, read the second file, add the values to those already in the hash for each key. And you're basically done.