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.