#!/usr/bin/perl use strict; use warnings; my $array_ref_x = [ [ 'ALICE WONDER', '9876543', '2009', '11.00', '711', '0', '0', '8' ], [ 'ALICE WONDER', '9876543', '2009', '11.00', '711', '3', '2', '0' ], ]; my %dual_ck = (); my $all_val; my @unique = (); foreach my $rows (@$array_ref_x){ next if $dual_ck{ $rows }++; push @unique, $rows; # trying here but did not work #my @unique = grep { ! $dual_ck{ $_ }++ } $rows; @$all_val = @unique; } print Dumper(@$all_val); #=cut # Here is what a happy end should be like ;-) =comment my $final_vals = [ [ 'ALICE WONDER', '9876543', '2009', '11.00', '711', '3', '2', '8' ], ]; =cut