Most programs involve a lot of infrastructure that can be reused for other purposes. This is why we have modules and design patterns. What you're looking at as a lot of work is, frankly, a lot of work. You're doing the following:

That you're dealing with names and addresses is irrelevant to the rest of the work you have to do. Just imagine how much work you would have to do if you didn't have open(), <>, regexes (or split), hashes (or arrays), and print() ... this is why we use Perl.

Now, once you have this infrastructure, there's a lot of different tasks that become a lot easier. Proper design and decomposition avoids bugs you didn't realize were possbile and enables features that you didn't even imagine you could have for as little effort as they end up being. I've lost count of the number of times I've told a boss "Because of doing things the right way, we now have some major feature that no-one even thought about that can now define our product."


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

In reply to Re: In place file modification by dragonchild
in thread In place file modification by RaduH

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.