Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Obtaining combinations of hash keys and values

by Anonymous Monk
on Apr 29, 2016 at 09:13 UTC ( #1161863=note: print w/replies, xml ) Need Help??


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 (Bishop) 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,

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1161863]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2019-05-27 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (155 votes). Check out past polls.

    Notices?