On Wed, Aug 08, 2001 at 08:56:59AM -0700, James Ferree wrote:
: Hi,
: 
: I am looking for a way to load a file containing the
: following example data into a hash
: 
: #From   TO
: Jim     James
: Art     Arthur
: John    Arthur
: 
: Then when $a=Jim I would like to convert it to
: $a=James.
: 
: Can this be done?

Yes it sure can.  Do you have the code that you tried this with?  If
you post it, we could help you through the errors.

The basic concept is this:

  Read the file one line at a time.
  For every line:
    Strip off the new line
    Split the line up into both names
    The first name is the key, the second is the value in a hash
  Access 'James', for example, like this: $hash{Jim}.

We'd be happy to walk you through some code if you show us what you
have.

  Casey West

-- 
Saying that Windows95 is equal to Macintosh is like finding a potato
that looks like Jesus and believing you've witnessed the second
coming. 
 -- Guy Kawasaki

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to