in reply to 3D arrays, again

I think this gets close to what your looking for

#! perl -slw use strict; my (@blocks, $datavertex); # Build the structure while(my $in = <DATA>) { if ( $in =~ /^88888/ ) { push @blocks, $datavertex; $datavertex = []; next; } my @vertex = ($in, scalar <DATA>, scalar <DATA>, 0); chomp @vertex; push @{$datavertex}, \@vertex; } push @blocks, $datavertex if @$datavertex; #! push the last block # Accessing it for my $block (0..$#blocks) { for my $dv ( 0 .. $#{$blocks[$block]} ) { for my $vertex ( 0 .. $#{$blocks[$block][$dv]} ) { print"[$block][$dv][$vertex] =>", $blocks[$block][$dv][$ve +rtex]; } print ''; } } __DATA__ 1 786.582394 1480.624270 2 877.141985 1284.635536 3 779.147607 1239.355735 4 688.588015 1435.344469 5 786.582394 1480.624270 88888 6 664.833374 241.139500 7 661.222659 245.226628

The output

22:44:50.88 C:\test>233619.pl [0][0][0] =>1 [0][0][1] =>786.582394 [0][0][2] =>1480.624270 [0][0][3] =>0 [0][1][0] =>2 [0][1][1] =>877.141985 [0][1][2] =>1284.635536 [0][1][3] =>0 [0][2][0] =>3 [0][2][1] =>779.147607 [0][2][2] =>1239.355735 [0][2][3] =>0 [0][3][0] =>4 [0][3][1] =>688.588015 [0][3][2] =>1435.344469 [0][3][3] =>0 [0][4][0] =>5 [0][4][1] =>786.582394 [0][4][2] =>1480.624270 [0][4][3] =>0 [1][0][0] =>6 [1][0][1] =>664.833374 [1][0][2] =>241.139500 [1][0][3] =>0 [1][1][0] =>7 [1][1][1] =>661.222659 [1][1][2] =>245.226628 [1][1][3] =>0

Examine what is said, not who speaks.

The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.