in reply to Re^7: Using regex with a variable
in thread Using regex with a variable

Hi Discipulus,

Thanks for your suggestions.

I have now done three changes to reduce the time taken.

1. Precompiled the regex and used them. This reduced the time taken from ~30 minutes to ~15 minutes. 2. Changed foreach loops to while loops 3. I managed to find the lines in input file which were responsible for longer runtime. I skipped parsing those lines, after confirming that they are not required. These lines were common in most of the input files.

After all this, time to run has come down from ~30 minutes to ~35 seconds.

A huge, huge, huge improvement.

Solving this issue has gotten me more interested in perl. Cant thank you enough for your help!