Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Sometimes it’s useful to take a “slice” of a multidimensional array or hash, or to select slices that have certain characteristics. Conversely, you may need to assemble a collection of lists into a two-dimensional array, or perhaps assemble a collection of two-dimensional arrays into a three-dimensional array. Perl’s map and grep operators are perfect choices for chores like these.
Begin with a program that reads a file of three-dimensional coordinates into memory. The example file has these data: