in reply to Text file to a 2D array
That's about it... pretty straightforwardmy @testarray; open(DATA, 'test.txt') or die $!; while(<DATA>) { chomp; #remove trailing \n push @testarray, [split ',', $_]; #[] makes anonymous # array with values from split, pushed on in order... # could use unshift if you wanted them reversed } close DATA;
|
|---|