in reply to Insert into element into arrays ref
Another way - UPDATING the contents of $data1 without replacing them,
and arguably easier on the eyes:
and arguably easier on the eyes:
UPDATE: Changed "for" to "while" to accomodate multi-key hashref in $data2, per aartist (++).while(my($k,$v)=each %{$data2->[0]}){ $_->{$k} = $v for @$data1; }
"From there to here, from here to there, funny things are everywhere." -- Dr. Seuss
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Insert into element into arrays ref
by AnomalousMonk (Archbishop) on Aug 23, 2019 at 05:04 UTC | |
by aartist (Pilgrim) on Aug 23, 2019 at 11:01 UTC |
In Section
Seekers of Perl Wisdom