sub indextime{ open FILE, "p2cashmast.txt"; select STDOUT; undef (@matrix); while (){ push @matrix, [split]; } $storenum = $matrix[0][0]; $date = $matrix[0][1]; #approx line 100 print "date $date \n "; print "store$storenum \n "; #@matrix[0] = undef; #@matrix[1] = undef; #@matrix[2] = undef; #@matrix[3] = undef; select OUTP; for $i (6.. ($#matrix-1)){ #$matrix[i][0] = $storenum; $matrix[i][0] = undef; print "@{$matrix[$i]} $storenum $date\n"; } }