in reply to Re: How to count the number of columns in a line
in thread How to count the number of columns in a line

Your code (that, what you wanted) should be as easy as:
my @match_A = split /\t/, $line; @list_of_headers= @match_A[4..$#match_A];
No need for a loop...
... provided @list_of_headers was empty beforehand! Otherwise use
push @list_of_headers, @match_A[4..$#match_A];

-- Hofmator

Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.