while (my $line = ) { next if $. == 1; next if $line =~ /^\s*chrM/; my ($chromosome, $nmreads, $mutants) = (split "\t", $line)[0, 8, 9]; # note: $chromosome is not used, this could be simplified further my $totalreads = $nmreads + $mutants; print ("$nmreads $mutants $totalreads\n"); }