You know, I'm just not "getting it" I guess.  When I read through
simple of examples in perldsc and perlfunc, it seems straightforward
enough, but when I try to put into practice everything, it doesn't go
as I might expect.

Recall this code I posted a day or two ago:

-------- 8-< -- snip --------

while (<DATA>) {
    chomp;
    ($listname, $field) = split(/:\s+/, $_);
    print "\nListname is $listname,\nField is: $field\n";
    %hrLists = split(/\s+/, $field);
    $Lists{$listname} = \%hrLists;
}

__DATA__
list-1: -x abc -r tenb
list-2: -x def -r ghi -h tenr
list-3: -x fel -h asci
list-4: -x foo -h nonasci -r bfab

-------- 8-< -- snip --------

Note the print in the while loop - essentially, when the hash is built,  my
goal is to be able to use $listname as a key to call up the value of a key in
the 2nd level hash.

I understand this:

foreach $listname (sort keys %Lists) {
    print "$listname\n";
}

But, I don't quite get how to get to the key values below that.  I know I'm so
close, but just not quite there...

Could some kind soul give me a blow by blow "what's happening here" going from 

        $Lists{$listname} = \%hrLists;

to printing out the key, values by $listname?


Thanks,
deb

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

Reply via email to