#! /usr/bin/perl -w
use strict;

# Open the external file
open my $MAT, '<', './matrix.dat';

my @A;
while ( my $line = <$MAT> ) {

    my @row = split ' ', $line; 
    chomp @row;
    push @A, \@row;
}    
close $MAT;

foreach my $rowref ( @A ) {
    print "@{$rowref}\n";
}
