Greetings!
How large are your files? Unless they are both very large it mght pay to read one (the update file) or both into hashes and/or arrays the walk through the update file and match the keys to the master file. As it is it appears you wil only read the first lien in the update file and the read the whole master file and then read the rest fo the keys. with the nested llops you wil lhave to read teh inner file on average many times (on average a number of complete passes thriugh the inner file equal to about 25% of the number of lines in the outer).
I am about to leave work but will send yo a little code when I get home.
I hope this will give you some ideas until I can send some code.
As always I am certain that if I mis-spoke a wandering monk wil correct my error. 8^)
Misha/Michael - Russian student, grognard, bemused observer of humanity and self professed programmer with delusions of relevance
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.