my @headers = split /\t/, ; while ( my $line = ) { chomp $line; next if not $line; # skip blank lines. my ($name, $rank, $serial_num, $iq, $hit_points) = split /\t/, $line; # Do whatever it is you want to with this info... }