use strict; use warnings; use Data::Dump qw (pp); my $accounts = [ { 'date' => '1980-03-05', 'year' => '2019', 'acc' => '44443', }, { 'date' => '1999-06-19', 'year' => '2017', 'acc' => '54321', }, { 'date' => '1999-09-19', 'year' => '2099', 'acc' => '12345', }, ]; my $all = [ { 'date' => '2000-01-00', 'year' => '2003', 'acc' => '4327', }, { 'date' => '1987-01-03', 'year' => '2013', 'acc' => '89997', }, { 'date' => '1980-04-18', 'year' => '2016', 'acc' => '239876A', }, { 'date' => '1999-06-19', 'year' => '2017', 'acc' => '54321', } ]; # add all hashes from $accounts to $all, but # exclude account 44443, if it is there foreach my $href (@$accounts) { push @$all, $href if $href->{acc} ne '44443'; #note string compare } pp $all; __END__ [ { acc => 4327, date => "2000-01-00", year => 2003 }, { acc => 89997, date => "1987-01-03", year => 2013 }, { acc => "239876A", date => "1980-04-18", year => 2016 }, { acc => 54321, date => "1999-06-19", year => 2017 }, { acc => 54321, date => "1999-06-19", year => 2017 }, { acc => 12345, date => "1999-09-19", year => 2099 }, ] Note: account OP's test $account data did contain a record that already exists in the $all array. This results in a duplicate record. See acc=> 54321 above. There are of course ways to prevent that duplication. Before suggesting code for that, I'd like to hear from the OP whether this can really happen in "the real world" and if such a solution is even needed.