Hi Bob
In general a hash is the way to go:
my @list1 = qw ( Apple Orange Lemon Tangerine Grape );
my @list2 = qw( Apple Tangerine Grape Banana );
my %list1 = map {($_ => 1) } @list1;
my @list3 = grep {$list1{$_}} @list2;
print "@list3";
output:
Apple Tangerine Grape
H
; From: Bob Williams [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 09, 2003 2:02 PM
> To: [EMAIL PROTECTED]
> Subject: Comparing Apples and Oranges
>
>
> I have two lists.
>
> List 1 is the control list containing: Apple, Orange, Lemon,
> Tangerine, and Grape.
Bob Williams wrote:
I have two lists.
List 1 is the control list containing: Apple, Orange, Lemon, Tangerine, and Grape.
List 2 contains Apple, Tangerine, Grape, and Banana.
I need a script that compares the two lists and will eliminate banana from list 2 because banana is not in the control L
I have two lists.
List 1 is the control list containing: Apple, Orange, Lemon, Tangerine, and Grape.
List 2 contains Apple, Tangerine, Grape, and Banana.
I need a script that compares the two lists and will eliminate banana from list 2
because banana is not in the control List 1. The script wil