Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.

In reply to Re^3: Hashes & Arrays by GrandFather
in thread Hashes & Arrays by Bugorr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-25 16:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found