in reply to Matrix Multiplication Problem

One small problem:

my @product = matrix_multiply(@matrix1, @matrix2);

should be

my @product = @{ matrix_multiply(\@matrix1, \@matrix2) };

The former is the same as:

my @product = matrix_multiply( $matrix1[0], $matrix1[1], $matrix1[2], $matrix2[0], $matrix2[1], $matrix2[2] ); # @product has only one element. # $product[0] is a ref to the resulting matrix