pdl [ [4, 2, 6, 8], [2, 5, 3, 4], [9, 5, 5, 6], [7, 4, 3, 6], ], pdl [ [21, 11.5, 15.5, 22], [2, 5, 3, 4], [9, 5, 5, 6], [7, 4, 3, 6], ], #### my @rows; my $j = 0; { local @ARGV = $ARGV[ 0 ]; while ( <> ) { my $i = 0; $rows[ $i++ ][ $j ] = $_ for split; $j++; } } my $dmat = pdl [ @rows[ 0, 1, 2, 3 ] ]; my $damat = pdl [ @rows[ 4, 1, 2, 3 ] ]; my $dbmat = pdl [ @rows[ 0, 4, 2, 3 ] ]; my $dcmat = pdl [ @rows[ 0, 1, 4, 3 ] ]; my $ddmat = pdl [ @rows[ 0, 1, 3, 4 ] ]; # proceed to compute the determinants of the $dmat, $damat, etc.