Keep in mind that an array is a list of scalar "things".
Luckily, since array references are scalar "things", your primary array can be made to hold 361 scalar references, each of which is referencing a unique 361-element array.
For those "secondary" arrays, your job is to somehow create 361 lists (arrays) and still be able to access them as scalar references. But hey, you can get one of those with [(0) x 361]
You only need to push 360 more onto the primary list where you stored that first one. :-)
Note: thanks to ikegami for pointing out the mistake with my previous statement that:
@row = ((0) x 361); is creating a one-element list whose element is a scalar string of 361 zeros.('0000000000000000 ... 00000')
In reply to Re^3: 2 D array
by ff
in thread 2 D array
by topaz
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.