Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Hashes & Arrays

by Bugorr (Novice)
on Aug 29, 2005 at 19:51 UTC ( [id://487527]=note: print w/replies, xml ) Need Help??


in reply to Re: Hashes & Arrays
in thread Hashes & Arrays

Dear vroom unfortunately I have no code and need help with that :)

Replies are listed 'Best First'.
Re^3: Hashes & Arrays
by GrandFather (Saint) on Aug 29, 2005 at 20:34 UTC

    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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-19 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found