my %for_later; foreach my $name (@array) { my $obj = new OBJ; do_stuff($obj); $for_later{$name} = $obj; }