Welcome to the Monastery | |
PerlMonks |
Re: Perl Code Runs Extremely Slowby TGI (Parson) |
on Jun 15, 2006 at 20:46 UTC ( [id://555619]=note: print w/replies, xml ) | Need Help?? |
Upon reviewing this thread, a new concern occurred to me. You may not be getting the results you want with this code. A hash only stores one value for each key, For example, if your data looks like: File 1: a 1 b 2 c 3 d 4 a 5 File2: a 10 b 11 c 20 c 12 Your output would be something like: a 5 10 b 2 11 c 3 12 d 4 If you were looking for something like: a 1 1 a 5 10 b 2 11 c 3 20 c 3 12 d 4you'll need to make some decions about how you handle duplicate keys in your files. If you need to keep all your data, I recommend reading the data structures cookbook. You will also need to move your data out of RAM and onto a disk (DB_File is probably the easiest way), since you won't be overwriting your data. The RAM issues samtregar mentioned will become particularly acute. If you are going to be building complex data structures, MLDBM will work better for you than DB_File. BTW, to create a hash tied to a DBM file, you can use:
In Section
Seekers of Perl Wisdom
|
|