oakbox has asked for the wisdom of the Perl Monks concerning the following question:
In real life, these hashreferences would each have between 50 and 150 elements. The above code isn't a huge drain, but it seems inelegant. Is there a handy methodology that I'm missing here?my $object; my $subobject; foreach my $keyn (keys %{$subobject}){ $object->{$keyn} = $subobject->{$keyn}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Merge Hashrefs
by Thilosophy (Curate) on Jan 10, 2005 at 12:36 UTC | |
by MiroslavK (Initiate) on Oct 15, 2014 at 15:32 UTC | |
by LanX (Saint) on Oct 15, 2014 at 15:40 UTC | |
by oakbox (Chaplain) on Jan 10, 2005 at 12:44 UTC | |
by BUU (Prior) on Jan 10, 2005 at 20:54 UTC |