Dear Perl Monks,
I'm retrieving large amount of data from a server and after some preprocessing I'm saving it locally in a text file (~3GB). Each time I'm processing a small chunk and I'm wondering if it's better to print the chunk straight after processing, print only let's say after 10 000 chunks (out of ~70,000) or perhaps store them all and print all at once? Speed is the most important part, thought I'm not sure if creating a 3GB array would be wise.
In regards to the data the chunk is split into hundreds of lines. the first line is an identifier and the rest should all by concatenated. I've used split by newline and then .= for that but perhaps join would be better? Or split with a limit of 2 and then use s/\n//g/ on the second part? Again speed is crucial.
Thanks for all the advice.
In reply to Print in loop or store and print once done by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |