my @interfaceref_array; for my $name (@list_of_junk) { my $hash_ref = { # curly brackets enclose junk_name => $name, # quotes not needed two => result_of_function($name), }; do_some_stuff(); $hash_ref->{three} = "toilet"; # quotes needed for value push @interfaceref_array, $hash_ref; } #### my @interfaceref_array; for my $name (@list_of_junk) { my %hash = ( # parentheses enclose junk_name => $name, two => result_of_function($name), ); do_some_stuff(); $hash{three} = "toilet"; push @interfaceref_array, \%hash; }