in reply to searching 2 arrays
Hi,
Try this one.
use strict;
use warnings;
local $\ = "\n";
my @DB = qw(AB1/1 AB1/5 AB2/5);
my @Input = qw(AB1/1 AB1/2 AB1/5 AB1/6 AB1/9 AB2/2 AB2/5 AB2/6 AB2/9 AB2/13);
foreach my $elt(@Input){
if(grep(/$elt/, @DB)){
print $elt.': Found'
}
else{
print $elt.': Not found';
}
}
Thanks,
Rajesh.K
|
|---|