Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: A Question with Nesting Arrays

by marinersk (Priest)
on Dec 06, 2013 at 22:43 UTC ( [id://1066072]=note: print w/replies, xml ) Need Help??


in reply to A Question with Nesting Arrays

You can use arrays of arrays of course, but if your dimensions are fixed, known, and consistent, why not just use two- or three- dimensional arrays and be done with it?
my @array = (); my $index_x = 0; my $index_y = 0; my $index_z = 0; {...} $arrays[$index_x][$index_y][$index_z] = 52;

Replies are listed 'Best First'.
Re^2: A Question with Nesting Arrays
by jethro (Monsignor) on Dec 07, 2013 at 02:11 UTC
    You hopefully are aware that your three dimensional array (at least in perl) is still an array of arrays. It sounds like you think of them as something different.

      Yes, internally. But it has been my experience that newcomers to the language can wrap their heads around the multidimensional syntax more quickly than diving straight into indirect references.

      And this is my third attempt to post this answer; for some reason, PerlMonks doesn't seem to want me to say this. If it fails a third time, I will surrender. :-)

Log In?
Username:
Password:

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

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

    No recent polls found