If this is my input:

Happy Cat Male
Evil Snake Female
Patches Dog Male
Bubbles Fish Female
Harley dog Female
Goldy Fish Male

What do I do so that the Name is the key and the Species and Gender together 
are the value?

while (<>) {
        chomp;

        %chars = split(' ', $_);
        $chars{$char}  = $ch;
        }

This is what I have so far but of course it only will read the first two 
things in each line.

I also found this bit of code - but it makes the gender the key and I want 
the name to be the key.

@raw = split (" ", $_);
if ($#raw == 1) {
   $names{$raw[1]} = $raw[0];
} else {
   $pn = " ";
   for ($i = 0; $i < $#raw; $i++) {
      $pn .= $raw [$i] . " ";
   }
   $names($raw[$#raw]} = $pn;
  }
}

Thanks,
Terri Harrison









_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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

Reply via email to