foreach (qw(CLIENT RECORD CONTROL ...)) { $hash{$_} =$data[$idx++]; }