#! perl -slw use strict; use Data::Dump qw[ pp ]; my $col; my @col; my $row; my @row; my $sheet; my @sheet; for($col = 0; $col < 3; $col++) { push @col, "0";} for($row = 0; $row < 3; $row++) { push @row, [@col];} for($sheet = 0; $sheet < 3; $sheet++){push @sheet, [@row];} $sheet[0][1][2] = 5; pp \@sheet; __END__ c:\test>junk38 do { my $a = [ [[0, 0, 0], [0, 0, 5], [0, 0, 0]], ['fix', 'fix', 'fix'], ['fix', 'fix', 'fix'], ]; $a->[1][0] = $a->[0][0]; $a->[1][1] = $a->[0][1]; $a->[1][2] = $a->[0][2]; $a->[2][0] = $a->[0][0]; $a->[2][1] = $a->[0][1]; $a->[2][2] = $a->[0][2]; $a; } #### for($sheet = 0; $sheet < 3; $sheet++){push @sheet, [@row];} #### #! perl -slw use strict; use Data::Dump qw[ pp ]; my $col; my @col; my $row; my @row; my $sheet; my @sheet; for($col = 0; $col < 3; $col++) { push @col, "0";} for($row = 0; $row < 3; $row++) { push @row, [@col];} for($sheet = 0; $sheet < 3; $sheet++){ push @sheet, [ map [ @$_ ], @row ]; } $sheet[0][1][2] = 5; pp \@sheet; __END__ c:\test>junk38 [ [[0, 0, 0], [0, 0, 5], [0, 0, 0]], [[0, 0, 0], [0, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 0, 0], [0, 0, 0]], ] #### #! perl -slw use strict; use Data::Dump qw[ pp ]; my @sheets = map { [ map { [ ( 0 ) x 3 ] } 1 .. 3 ] } 1 .. 3; $sheets[0][1][2] = 5; pp \@sheets; __END__ c:\test>junk38 [ [[0, 0, 0], [0, 0, 5], [0, 0, 0]], [[0, 0, 0], [0, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 0, 0], [0, 0, 0]], ]