On Tue, 2002-09-17 at 12:37, pravesh biyaNI wrote:
> Hi'
> Are there multidimensional arrays in Perl.
>
> for e.g can we write the way we write in C
>
> $elements[0][0]= something;
>
>
> etc..etc..
>
> regards
> pravesh
Short answer: yes.
Long Answer: There are arrays can hold scalars; a reference to an array
is a scalar; therefore you can have an array of arrayrefs. Happily
there is a bit of syntatic sugar that lets you say
$array[0][4] = 10;
instad of
$array[0]->[4] = 10;
Note that this also lets you combine associative arrays (AKA hashes) and
arrays:
$control{'PCI'}[5]{'wanklefutzer'} = 10;
As you start messing with multidimensional data structures the
Data::Dumper module will become your friend. In the case above you
could say
print Dumper(\%control);
to find out what exactly is in the hash named control.
--
Today is Setting Orange the 41st day of Bureaucracy in the YOLD 3168
Kallisti!
Missile Address: 33:48:3.521N 84:23:34.786W
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]