The problem is that you are processing (
splitting) @flab lines 14.4 million (200 @flab lines x 72,000 LONG_LIST lines = 14.4 million
splits) times, when you should process them only 200 times. You should pre-process the @flab lines and put them into a usable data structure so that, once you've gotten a line from LONG_LIST ready, it's just a straight-up comparison.
I'm not going to write your code for you, but you basically need to move
#split each @flab line into two fields ‘Name’ and ’Title'
my @match = split (/\t/,$line);
so that it happens before you enter your
while loop to work on LONG_LIST. I'll be very surprised if that doesn't make a huge difference in the time it takes to run your script. It would be very much appreciated if you would let all of us know your results after the change.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.