Like this?:

#!/usr/bin/perl use strict; use warnings; use Data::Dump qw[ pp ]; my $data1 = [ { 'NAME' => '1PAUL DY', 'DATE' => '12009-05-05', 'NUMBER' => '1000 +01', 'ACC' => '1A1A', }, { 'NAME' => '2PAUL DY', 'DATE' => '2011-01-05', 'NUMBER' => '20033 +1', 'ACC' => '2A3B', }, { 'NAME' => '4PAUL DY', 'DATE' => '42011-01-05', 'NUMBER' => '4200 +331', 'ACC' => '6A4B', }, ]; my $data2 = [ { 'EXT1' => '1b', 'EXT2' => '12b', 'EXT3' => '13b', 'EXT4' => '14d' +, 'ACC' => '1A1A', }, { 'EXT1' => '2b', 'EXT2' => '2b', 'EXT3' => '2b', 'EXT4' => '2d', ' +ACC' => '2A3B', }, { 'EXT1X' => '4b', 'EXT2X' => '4b', 'EXT3X' => '4b', 'EXT4X' => '4d +', 'ACC' => '4A4B', }, ]; for my $i ( 0 .. $#{ $data1 } ) { if( $data1->[ $i ]{ ACC } eq $data2->[ $i ]{ ACC } ) { $data1->[ $i ]{ $_ } = $data2->[ $i ]{ $_ } for keys %{ $data2 +->[ $i ] } } } pp $data1; __END__ C:\test>1148951.pl [ { ACC => "1A1A", DATE => 12009-05-05, EXT1 => "1b", EXT2 => "12b", EXT3 => "13b", EXT4 => "14d", NAME => "1PAUL DY", NUMBER => 100001, }, { ACC => "2A3B", DATE => 2011-01-05, EXT1 => "2b", EXT2 => "2b", EXT3 => "2b", EXT4 => "2d", NAME => "2PAUL DY", NUMBER => 200331, }, { ACC => "6A4B", DATE => 42011-01-05, NAME => "4PAUL DY", NUMBER => +4200331 }, ]

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Merging Data into one array by BrowserUk
in thread Merging Data into one array by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.