in reply to How Would this Input File Work?

Well, first you need to open the file. Then call a split and assign the hash accordingligly. Here goes (it's untested, but it should work):

$IN = '/path/to/file'; open IN; while(<IN>) { next if /^$/; ($key,$value) = split /\s*:\s*/; $hash{uc $key} = $value; }
If you wish to store multiple names in the same hash, however(for example, the file has many Contact_Names, you need to devise a better way, and need to decide what you want to sort by. One option would be to store on Contact_Name, assuming they are all unique. You could then make the contact_name key point to a reference to a hash, which would store the rest of the information. There are *many* different ways to do this and go about it, but it all depends on the data you are expecting.

Replies are listed 'Best First'.
Re: Re: How Would this Input File Work?
by footbinc (Initiate) on Jun 20, 2001 at 22:03 UTC
    Your a brilliant man. Thanks :) Worked like a charm. Thanks again ben