in reply to Re: Obtaining combinations of hash keys and values
in thread Obtaining combinations of hash keys and values

I'm guessing I will need to print to an output file instead of storing combinations in a hash for large input amounts otherwise the RAM requirement is off the charts!
  • Comment on Re^2: Obtaining combinations of hash keys and values

Replies are listed 'Best First'.
Re^3: Obtaining combinations of hash keys and values
by choroba (Cardinal) on Apr 29, 2016 at 09:26 UTC
    You can't print before you've read the whole file, otherwise you don't know the counts. If this is really a problem (test it and see), you can store just line numbers in the hash instead of the full blocks, and then read the file for the second time and print the numbers (but only print the first block for each corresponding key!).

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,