Thanks, Steve, for your feedback.  As I said in private email to Steve
earlier today, I don't mind someone thumping the FM to me - problem is, I've
been reading all the FM I could find, including all those mentioned here.
Got the printouts right in front of me.

But I've been confused by different approaches presented, vs. what I need to
do... which is why I think I got close, but not quite there.

I was still getting hung up in the syntax especially as it relates to
anonymous data structures, vs named ones.  Not really apples and oranges, but
one really needs to understand syntactically how to pull it out of annonymous
hashes, if you *don't* want to use a literal to obtain a key,

        $xKey = $hash{'-x'} 

to then iterate over the hash to get the value. Yuck.

Still chewing on the bones...

deb


Steve Grazzini <[EMAIL PROTECTED]> had this to say,
> 
> Don't mean to thump the FM, but have you seen the 
> "Access and Printing of a HASH OF HASHES" section 
> in perldsc?  Your %Lists is a perfect %HoH.
> 
> But anyway, as you've probably seen, the ordinary 
> "print a hash" loop...
> 
>     for my $key (sort keys %Lists) {
>       print "$key => $Lists{$key}\n";
>     }
> 
> Produces something like this.
> 
>     list-1 => HASH(0x80fb32c) 
> 
> Where "HASH(0x80fb32c)" represents the hash reference.
> you created way... back.. here:
> 
>     $Lists{$listname} = \%hrLists;
>     #                   ^
>     # backslash creates a reference
>     #
> 
> So what you've got is a nested data structure; a 
> hash (%List) whose values are references to more 
> hashes.
> 
> To print it out, you just need two loops, an outer
> loop for %Lists, and an inner loop to iterate over
> the nested hashes.
> 
>   for my $list (sort keys %Lists) {
>     print "$list: \n";
> 
>     my $ref = $Lists{$list};
> 
>     #
>     # use "%{$ref}" to dereference
>     #
>     for my $key (sort keys %{$ref}) {
>       print "  $key : $ref->{$key}\n";
>     }
>   }
> 
> And besides perldsc, you might find these handy if
> you're learning/working-with references:
> 
>   $ perldoc perlreftut
>   $ perldoc perlref
>  
> -- 
> Steve
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
          There are 010 types of people in the world:
       those who understand binary, and those who don't.
τΏτ   111,111,111 x 111,111,111 = 12,345,678,987,654,321 (decimal)
 ~ 







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

Reply via email to