my %search; @search{@DB} = (); for (@Input) { print exists $search{$_} ? "$_ : Found $_\n" : "$_ : Not Found $_\n"; }