# To find unique elements in each array: #!/usr/bin/perl use warnings; use List::Compare; # Use of module @x= qw/b/; push @p,@x; @y= qw/c/; push @p,@y; @z= qw/d/; push @p,@z; $num=-1; for (@p) {$num++; # for LOOP starts @arr = $p{$num}; $s=\@arr; # Problem is here. # If 's' becomes s1, s2, s3 while passing # through LOOP then the program may work. # How can I change s to s1, s2, s3 etc.? push @s,$ref; } # for LOOP ends $num_ele=@s; print "\n Array s: @s\n No. of Elements: $num_ele\n"; $all= List::Compare->new(@s); # module @unq_x=$all->get_unique(0); @unq_y=$all->get_unique(1); @unq_z=$all->get_unique(2); print " unq_x: @unq_x\n unq_y: @unq_y\n unq_z: @unq_z\n\n"; exit;