#!/usr/bin/env perl #Good practice (prevents autovivification) use strict; my (@x, @y1, @y2, @y3, @y4); open FILE, '<:crlf', "test.txt"; #Get and store header data chomp(my $headerline=); my @headerdata=split /\t/, $headerline; #Process each subsequent line of the file, storing the current line in $_ while() { #Remove newline from $_ (var holding current line) chomp; #Split $_ using tab as delimeter and store contents in @rowdata my @rowdata=split /\t/; #Store first column of the line in @x, etc.. push @x, shift @rowdata; push @y1, shift @rowdata; push @y2, shift @rowdata; push @y3, shift @rowdata; push @y4, shift @rowdata; } close FILE; print "Array headerdata: @headerdata\n"; print "Array x: @x\n"; print "Array y1: @y1\n"; print "Array y2: @y2\n"; print "Array y3: @y3\n"; print "Array y4: @y4\n";