I am trying to read some numbers from a text file and store it as a 2 dimensional array. I read a line and push into another array as an array reference. But I noticed that main array only has last line in all rows. How can i correct this? Thanks in advance. This is part i do it.
open IN, "a.txt";
@b=();
while (<IN>)
{
$t =$_;
@a = split /\s+/,$t;
push(@b, \@a);
}