in reply to 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; push @list_of_headers, @match_A[4..$#match_A];
@list_of_headers= @match_A[4..$#match_A];
No need for a loop...

Update: Thanks to Hofmator for correcting me! ++

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Replies are listed 'Best First'.
Re^2: How to count the number of columns in a line
by Hofmator (Curate) on Aug 31, 2006 at 13:44 UTC
    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.