I want to find duplicate Arrays from hash that contains arrays. Point is, I am trying to develop sets and storing them into hash table of Perl. After, I need to extract 1. those arrays which are completely duplicate(Having all values same). 2. Intersection of arrays
Source code is given as under:
use strict;
use warnings;
my @test1= ("Bob", "Flip", "David");
my @test2= ("Bob", "Kevin", "John", "Michel");
my @test3= ("Bob", "Flip", "David");
my @test4= ("Haidi", "Bob", "Grook", "Franky");
my @test5= ();
my @test6=();
my %arrayHash= ( "ppl1" => [@test1],
"ppl2"=> [@test2],
"ppl3" => [@test3],
"ppl4"=> [@test4],
"ppl5"=> [@test5],
"ppl6"=> [@test6],
);
Required Output: ppl1 and ppl3 have duplicate lists
Intersection of arrays= Bob
Kindly note that duplication of empty arrays is not desired!