in reply to How Would this Input File Work?
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.$IN = '/path/to/file'; open IN; while(<IN>) { next if /^$/; ($key,$value) = split /\s*:\s*/; $hash{uc $key} = $value; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How Would this Input File Work?
by footbinc (Initiate) on Jun 20, 2001 at 22:03 UTC |