in reply to Match string in array
@FirstArray=qw(A B C D); @SecondArray=qw(D E F B); foreach $pr (@FirstArray){ #print "Property: $pr\n"; @match=(); @match=grep(/$pr/,@SecondArray); if (!@match){ push(@UniqueInFirstArrayNotFoundInSecondArray,$pr); } else { push(@FoundInBothArrays,$pr); } } print "".join("\n",@UniqueInFirstArrayNotFoundInSecondArray)."\n"; print "".join("\n",@FoundInBothArrays)."\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Match string in array
by sauoq (Abbot) on Oct 03, 2005 at 19:18 UTC |
In Section
Seekers of Perl Wisdom