For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > June 2004 > Beginner question, how do I do multidimentional array?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Beginner question, how do I do multidimentional array?
Kelvin

2004-06-24, 7:00 pm

Is there 2D and 3D array in Perl?
How do I use that?

Kelvin


Carsten Aulbert

2004-06-24, 7:00 pm

Hi Kelvin,

Kelvin wrote:
> Is there 2D and 3D array in Perl?

yes, even 4d, 5d, ... and not only arrays, but also "3d hashes"

> How do I use that?

Try for example
perldoc perlreftut

@a = ( [1, 2, 3],
[4, 5, 6],
[7, 8, 9]
);
print $a[1]->[2];


HTH

Carsten
Kelvin

2004-06-24, 7:00 pm

Got it...
thank you!

Kelvin



"Carsten Aulbert" <usenet.aulbert@welcomes-you.com> wrote in message
news:2hinkjFd8ujnU1@uni-berlin.de...
> Hi Kelvin,
>
> Kelvin wrote:
> yes, even 4d, 5d, ... and not only arrays, but also "3d hashes"
>
> Try for example
> perldoc perlreftut
>
> @a = ( [1, 2, 3],
> [4, 5, 6],
> [7, 8, 9]
> );
> print $a[1]->[2];
>
>
> HTH
>
> Carsten



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com