#!/usr/bin/perl -w use strict; open(FH, "/Users/Desktop/Gene.txt") or die; my @content = (); close(FH); my @myArray; for my $row (@content) { my @columns = split ' ', $row; push @myArray, \@columns; } my $title_row = shift @myArray; for my $row (@myArray) { my $sum = 0; for my $col (1 .. $#$row) { $sum += $row->[$col]; } print "$row->[0] is $sum\n"; }