in reply to Re: HoH question
in thread HoH question

Thanks ikegami. Although your solution is better than mine was, it's still not exactly what I need. The results are as follows. Note jennifer, employment, clara and susan only has one 'entry'.

%hash = ( 'clara' => { 'Sandra@camrpc.com' => 'Host not found' }, 'jack' => { 'JHuffman@pulsetech.net' => 'cannot find your ho +stname' }, 'tim' => { 'millionairemaker@freshcornam.com' => 'cannot fin +d your hostname' }, 'russ' => { 'orders@koss.com' => 'Host not found' }, 'susan' => { 'linda@kepro.com.tw' => 'cannot find your hostn +ame' }, 'employment' => { 'LifeShopDirect@freshcornam.com' => 'Host +not found' }, 'jobs' => { 'kwillis@cors.com' => 'Host not found' }, 'jennifer' => { 'Warranty@onlogixx.com' => 'cannot find your + hostname' } );

Replies are listed 'Best First'.
Re^3: HoH question
by ikegami (Patriarch) on Oct 06, 2005 at 06:27 UTC
    oops, didn't notice. Change
    $hash{$array[0]} = { $array[1] => $array[2] };
    to
    $hash{$array[0]}{$array[1]} = $array[2];
    which is a shortcut for
    $hash{$array[0]} = {} if not defined $hash{$array[0]}; $hash{$array[0]}{$array[1]} = $array[2];