in reply to How to process with huge data's

I don't see major faults in your script, but that much data should easily be calculated within a few minutes, if not seconds. However, here are a few problems.

Drop the $inputtext = $_ assignment, and change your top-level regexps to have an anchor in the beginning:

if (m/^q (\d+) (\d+)/)

Second, the m/\b$fnum\b[^\|]*\b$snum\b/ regexps are forcing the regexp engine to recompile that on almost every run (as the variables change). This is highly inefficient -- the whole if/elsif/else chain should be parsed differently. I'm not sure what the purpose of that block is, but at the very least you can change some of $fnum/$snum into \d+

Replies are listed 'Best First'.
Re^2: How to process with huge data's
by Anonymous Monk on Oct 04, 2011 at 14:52 UTC

    Er, one major fault after all: You seem to be building a huge string called $connectionText, and running loads of regexps on it. You should look into replacing it -- a hash might be suitable.