my @cols = qw(name email office); while (my $record = ) { chomp $record; my %person; @person{@cols} = split /\t/, $record; # now do something interesting with %person }