in reply to Hashes & Arrays

Start with perllol and perldata then do a Super Search for HoAoH.

When you have sample code that you are having trouble with, post a follow up question here and we will leap in to help.


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^2: Hashes & Arrays
by Bugorr (Novice) on Aug 29, 2005 at 19:51 UTC
    Dear vroom unfortunately I have no code and need help with that :)

      A first step is to read the documentation. Then draw the data as it will be structured on paper, or other suitable material of your choice, using indentation to show the nesting of the various elements and either {}, () or [] as appropriate to show the type of element. So for example and array of arrays (AoA) might look like this:

      ( ["1 in 1", "2 in 1", "3 in 1"], ["1 in 2", "2 in 2", "3 in 2", "4 in 2"], ["1 in 3", "2 in 3"] )
      Then you can do stuff like
      my @array = ( ["1 in 1", "2 in 1", "3 in 1"], ["1 in 2", "2 in 2", "3 in 2", "4 in 2"], ["1 in 3", "2 in 3"] );

      to create the array of arrays. Of course until you show us a little code so that we can see what you are trying to achieve it is hard to help much more than that. And yes, I do know that you are after a different data structure than that, but I'm sure with a little work you can at least get to the point of writing some code, even if it doesn't do what you expect.


      Perl is Huffman encoded by design.
Re^2: Hashes & Arrays
by InfiniteSilence (Curate) on Aug 29, 2005 at 19:54 UTC
    Hey GrandFather, we shuold have a "Homework" node, no?

    Celebrate Intellectual Diversity