in reply to dynamically referenced hashes ... editing

You are also, in what I assume is a typo, referencing two different hashes: $hash_ref and $interface_hash_ref.

Per kennethk's reply, what you have might be more conscisely written (assuming use warnings; and use strict;) as:

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; }
Or even as:
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; }

Replies are listed 'Best First'.
Re^2: dynamically referenced hashes ... editing
by chrishowe (Acolyte) on Jan 28, 2009 at 09:55 UTC
    Excellent :-)
    It was a typo in the example, but not in the code, I tried to simplify it for ease of reading.
    Question answered anyway
    Cheers!
    Chris