in reply to Compare arrays
i must say, i'm not sure if you were looking for something like this but :
as the result you have an array_2 that has a unique set of all elements of array_2 plus those that are in array_1 and not in array two#!/usr/bin/perl use strict; my @array_1 = qw(a b r gf s fg h j); my @array_2 = qw(g d s a b t z nbn df ert uz e ww); push (@array_2, grep{my $x = $_; not grep{$_ eq $x}@array_2}@array_1); print "@array_2\n";
cheers
|
|---|