Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: HoH question

by cajun (Chaplain)
on Oct 06, 2005 at 06:12 UTC ( [id://497826]=note: print w/replies, xml ) Need Help??


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];

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://497826]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (8)
As of 2024-04-18 14:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found