Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $data1 = [ { 'NAME' => 'PAUL DY', 'DATE' => '2009-05-05', 'NUMBER' => '00001', }, { 'NAME' => 'ANTHONY RD', 'DATE' => '2012-01-07', 'NUMBER' => '00003', }, { 'NAME' => 'RUTH RD', 'DATE' => '2018-01-07', 'NUMBER' => '00023', }, ]; my $data2 = [ { 'CODE' => 'X11', } ]; @$data1= ({map { %$_ } (@$data1, @$data2)}); print Dumper $data1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Insert into element into arrays ref
by Fletch (Bishop) on Aug 22, 2019 at 17:27 UTC | |
by Anonymous Monk on Aug 22, 2019 at 18:43 UTC | |
by AnomalousMonk (Archbishop) on Aug 22, 2019 at 18:47 UTC | |
by BillKSmith (Monsignor) on Aug 22, 2019 at 20:37 UTC | |
|
Re: Insert into element into arrays ref
by NetWallah (Canon) on Aug 23, 2019 at 00:15 UTC | |
by AnomalousMonk (Archbishop) on Aug 23, 2019 at 05:04 UTC | |
by aartist (Pilgrim) on Aug 23, 2019 at 11:01 UTC | |
|
Re: Insert into element into arrays ref
by aartist (Pilgrim) on Aug 23, 2019 at 10:43 UTC | |
by AnomalousMonk (Archbishop) on Aug 23, 2019 at 14:25 UTC |