Ananda has asked for the wisdom of the Perl Monks concerning the following question:
my @arr_in_1 =("User1","user2","user3"); my @arr_in_2 =("user2","user3","User4"); my @union_arr; foreach my $arr_1(@arr_in_1) {push(@union_arr,$arr_1);} foreach my $arr_1(@arr_in_1) { #print "The value in array 1 is :" .lc $arr_1."\n"; foreach my $arr_2(@arr_in_2) { #print "the value in array 2 is :". lc $arr_2." \n"; if (lc $arr_2 ne lc $arr_1) { push(@union_arr,$arr_2); } } } print "union array @union_arr";
Edit kudra, 2002-10-27 Added code tags
Anandatirtha
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Union of arrays
by Zaxo (Archbishop) on Oct 26, 2002 at 08:29 UTC | |
by thpfft (Chaplain) on Oct 26, 2002 at 12:06 UTC | |
Re: Union of arrays
by blokhead (Monsignor) on Oct 26, 2002 at 07:57 UTC | |
Re: Union of arrays
by Enlil (Parson) on Oct 26, 2002 at 07:50 UTC | |
Re: Union of arrays
by hopes (Friar) on Oct 27, 2002 at 03:55 UTC | |
Re: Union of arrays
by Ananda (Pilgrim) on Oct 26, 2002 at 11:35 UTC | |
by Aristotle (Chancellor) on Oct 26, 2002 at 12:37 UTC |