my @field_names = qw/ ParentNodeId NodeId level canode label theme template /; # and so on for the rest #### my %attributes; @attributes{ @field_names } = split /,/, $line; #### $esec->set_att( %attributes );