## Load values into the Array ### $Test_File = "test_file.txt"; open (TESTFILE, "$Test_File"); while () { @tmp = split; # Split elements into an array. push @AoA, [ @tmp ]; # Add an anonymous array reference to @AoA. } close (TESTFILE); ## Print the totals for each line ### for $i ( 0 .. $#AoA ) { $row = $AoA[$i]; for $j ( 0 .. $#{$row} ) { $Total_Balance[$i] += "$row->[$j]"; } print "the total is: ($Total_Balance[$i])
"; }