in reply to Learning Exercise

I am not a good perl programmer, so take my advice with a grain of salt. The way I would implement the address book entry removal would be to remove the relevant hash entries and write out all hashes to the file, replacing the old address book. For this you will need to open the addybase.adb like this:

open ADDYBASE, ">addybase.adb";

There are a few BUTs with this approach:

I am sure some perlmonks will suggest better alternatives, I just wanted to give my (hopefully useful) thoughts about the subject.

Replies are listed 'Best First'.
Re: Re: Learning Exercise
by Foncé (Scribe) on Jul 18, 2002 at 12:50 UTC
    Yes, that would work, as I've done something very similar in BASIC before, but you're right: it's not efficient.

    My other question, which I forgot to post, but you can see in the code, is this: I want to search for a particular entry. What's the best way to do that, given the code I've written and my fairly basic understanding of Perl thusfar?