my %comment_cols = qw/ c_title title author author id thread_id c_id id /; for (@comments) { my %data; @data{keys %comment_cols} = $_->get(values %comment_cols); push @c_data, \%data; }