while () { my %data; chomp; @data{@keys} = split /\t/; # then call subroutine }