foreach $line ( ) { if( $line =~ /^Name/ ) { @columnNames = split(/\t/, $line); } else { push @rowValues, [ split(/\t/, $line) ]; } }