Help for this page

Select Code to Download


  1. or download this
    @union = sort grep { not $seen{$_}++ } (@union, @array3);
    
  2. or download this
    my @array1 = ([b=>1], [d=>3], [z=>4], [e=>5]);
    my @array2 = ([a=>2], [b=>1], [z=>4]);
    my @array3 = ([d=>3], [e=>5]);
    
  3. or download this
    my %seen;
    my @union = grep { not $seen{$_->[0]}++ } (@array1, @array2);
    ...
    
    use Data::Dumper;
    print Dumper \@union;