in reply to How to Create Hash From this Array

I want some clarification. Are you trying to create a hash with the keys of "A, B, C, D, E, and F", or are you trying to create a multi-dimensional datastructure, a hash of hashes of hashes of hashes (and so on)?

Here are a couple examples of "how to do it", depending on what it actually is:

# Create a hash with keys from @asdf my %hash; @hash{ @asdf } = (); # Use a hash slice. # Create a multidimensional datastructure: my $href; foreach my $key ( reverse @asdf ) { $href = { $key => $href }; }

The latter approach creates a datastructure referenced by $href. It's built "in reverse" just to simplify the algorithm.


Dave