use strict;
use warnings;
use 5.010;
my $file = 'matrixin.txt';
my @data;
open( FILE, $file ) or die "Can't open file '$file': $!";
while(
chomp;
my @row = split;
push @data, \@row;
}
close( FILE );
#Print output
for my $i (0..$#data)
{
for my $j (0..$#{$data[0]})
{
print "$data[$i][$j]","\t";
}
print "\n";
}
No comments:
Post a Comment