in reply to Perl script is getting stuck for no reason
I suspect you mean "hang" in the sense of "doesn't seem to be producing any output even after a long time" as opposed to a more precise use of "hang" for "stops consuming CPU but doesn't exit".
The most likely explanation is that the performance of your script is not linear so the much bigger file just takes significantly longer to process. The most likely explanation for seriously non-linear performance given some of what you said is that your process ends up using more memory than your computer can efficiently provide it.
But such possibilities are easy for you to investigate, requiring, at most, some internet searching and minor research to learn a couple of commands and how to interpret part of their output (such as top and ps).
Of course, maybe you have already investigated those possibilities and eliminated them. But I can't tell that based on what little information you provided.
Identifying whether or not the problem is just "using too much memory" is a good step to do before diving into the search for a more specific source of the problem. Hence, I didn't dive into the code you have now added to your posting.
Good luck.
BTW, further updates to your question are better done as replies rather than as modifying the original question. The site does not provide a way for people to notice that you've made an update (while there are several heavily used way to notice new replies). Also, updates tend to make the thread confusing.
- tye
|
|---|