Using multi-dimensional array references again. : Multidimensional Arrays « Array « Perl






Using multi-dimensional array references again.

    
#!/usr/bin/perl 

$line = ['solid', 'black', ['1','2','3', ['4', '5', '6']]]; 
print "\$line->[0] = $line->[0] \n"; 
print "\$line->[1] = $line->[1] \n"; 
print "\$line->[2][0] = $line->[2][0] \n"; 
print "\$line->[2][1] = $line->[2][1] \n"; 
print "\$line->[2][2] = $line->[2][2] \n"; 
print "\$line->[2][3][0] = $line->[2][3][0] \n"; 
print "\$line->[2][3][1] = $line->[2][3][1] \n"; 
print "\$line->[2][3][2] = $line->[2][3][2] \n"; 
print "\n"; 

   
    
    
    
  








Related examples in the same category

1.Multidimensional Arrays(Lists of Lists)
2.Using multi-dimensional array references.
3.Lists of Lists
4.How to use two dimensional arrays
5.Output two -dimensional array
6.References to Simulate Multi-Dimensional Arrays
7.Using array reference to create two-dimensional array
8.Using @ operator and one dimensioanal array to create two dimensioanl array
9.Two dimensional array is array of array
10.A three-dimensional array
11.Using array reference to index the two dimensional array
12.Using two-dimensional array
13.Program to demonstrate a pointer to a two-dimensional array
14.'use strict' with two dimensional array
15.Array of array
16.Reference the outter array of an two dimensional array
17.Two dimensional array is array scalar plus array
18.Using the -> to reference the elements of a two-dimensional array